-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.go
More file actions
36 lines (31 loc) · 1.29 KB
/
error.go
File metadata and controls
36 lines (31 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// =============================================================================
// Project: tinyfmt
// File: error.go
// Description: Functions for formatting error messages.
// Datasheet/Docs:
//
// Author: Jason Duffy
// Created on: 07/07/2024
//
// Copyright: (C) 2024, Jason Duffy
// License: See LICENSE file in the project root for full license information.
// Disclaimer: See DISCLAIMER file in the project root for full disclaimer.
// =============================================================================
// -------------------------------------------------------------------------- //
// Import Statement //
// -------------------------------------------------------------------------- //
package tinyfmt
import (
"errors"
)
// -------------------------------------------------------------------------- //
// Public Functions //
// -------------------------------------------------------------------------- //
// Errorf formats according to a format specifier and returns the string as a value that satisfies error.
func Errorf(format string, arguments ...interface{}) error {
result, err := Sprintf(format, arguments...)
if err != nil {
return err
}
return errors.New(result)
}