-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update database setup and removed vendor files
- Loading branch information
Showing
47 changed files
with
262 additions
and
4,732 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ private.* | |
bin/* | ||
*.exe | ||
*.db | ||
guildBackups/* | ||
guildBackups/* | ||
vendor/* |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// Package multierror impements handling | ||
// multiple errors as one error object. | ||
// Authors: Ringo Hoffmann. | ||
package multierror | ||
|
||
import ( | ||
"errors" | ||
"fmt" | ||
"strings" | ||
) | ||
|
||
// FormatFunc is the function used to format an | ||
// error element of a MulitError | ||
type FormatFunc func(i int, e error) string | ||
|
||
// MultiError contains multiple error objects | ||
// and the frmatting function for concating into | ||
// one handable error object | ||
type MultiError struct { | ||
errors []error | ||
formatFunc FormatFunc | ||
} | ||
|
||
// New creates a new instance of MultiError | ||
// using the passed format function. If this argument | ||
// is nil, the default format function will be used. | ||
func New(formatFunc FormatFunc) *MultiError { | ||
if formatFunc == nil { | ||
formatFunc = func(i int, e error) string { | ||
return fmt.Sprintf("MultiError %02x: %s\n", i, e) | ||
} | ||
} | ||
|
||
return &MultiError{ | ||
formatFunc: formatFunc, | ||
} | ||
} | ||
|
||
// Append adds an error object to the | ||
// MultiError cotainer if the error | ||
// is != nil | ||
func (m *MultiError) Append(err error) { | ||
if err != nil { | ||
m.errors = append(m.errors, err) | ||
} | ||
} | ||
|
||
// Len returns the ammount of errors contained | ||
// in the MultiError container | ||
func (m *MultiError) Len() int { | ||
return len(m.errors) | ||
} | ||
|
||
// Concat creates one handable error object | ||
// from all errors in the MultiError container | ||
// using the formatting function. | ||
func (m *MultiError) Concat() error { | ||
if m.Len() == 0 { | ||
return nil | ||
} | ||
|
||
if m.Len() == 1 { | ||
return m.errors[0] | ||
} | ||
|
||
strErrArr := make([]string, m.Len()) | ||
for i, e := range m.errors { | ||
strErrArr[i] = m.formatFunc(i, e) | ||
} | ||
|
||
return errors.New(strings.Join(strErrArr, "")) | ||
} |
Submodule discordgo
deleted from
8325a6
Submodule snowflake
deleted from
68117e
Submodule sadbox
deleted from
27893f
Submodule vibrant
deleted from
563623
Oops, something went wrong.