generated from snivilised/astrolib
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34215e3
commit 08a3d01
Showing
11 changed files
with
70 additions
and
146 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
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 |
---|---|---|
|
@@ -44,6 +44,7 @@ | |
"Malloc", | ||
"mattn", | ||
"nakedret", | ||
"nicksnyder", | ||
"nolint", | ||
"nolintlint", | ||
"Nonblocking", | ||
|
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 |
---|---|---|
@@ -1,28 +1,25 @@ | ||
module github.com/snivilised/pants | ||
|
||
go 1.22.0 | ||
go 1.23.0 | ||
|
||
require ( | ||
github.com/nicksnyder/go-i18n/v2 v2.4.0 | ||
github.com/onsi/ginkgo/v2 v2.20.0 | ||
github.com/onsi/gomega v1.34.1 | ||
github.com/snivilised/extendio v0.7.0 | ||
) | ||
|
||
require ( | ||
github.com/avfs/avfs v0.33.0 // indirect | ||
github.com/go-logr/logr v1.4.2 // indirect | ||
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect | ||
github.com/google/go-cmp v0.6.0 // indirect | ||
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect | ||
github.com/kr/pretty v0.3.1 // indirect | ||
github.com/nicksnyder/go-i18n/v2 v2.4.0 // indirect | ||
github.com/pkg/errors v0.9.1 // indirect | ||
github.com/samber/lo v1.39.0 // indirect | ||
github.com/snivilised/lorax v0.6.1 // indirect | ||
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect | ||
github.com/rogpeppe/go-internal v1.11.0 // indirect | ||
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect | ||
golang.org/x/net v0.28.0 // indirect | ||
golang.org/x/sys v0.23.0 // indirect | ||
golang.org/x/sys v0.24.0 // indirect | ||
golang.org/x/text v0.17.0 // indirect | ||
golang.org/x/tools v0.24.0 // indirect | ||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
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
File renamed without changes.
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 |
---|---|---|
@@ -1,56 +1,52 @@ | ||
package locale | ||
|
||
import ( | ||
"github.com/snivilised/extendio/i18n" | ||
) | ||
|
||
// ❌ FooBar | ||
|
||
// FooBarTemplData - TODO: this is a none existent error that should be | ||
// replaced by the client. Its just defined here to illustrate the pattern | ||
// that should be used to implement i18n with extendio. Also note, | ||
// that this message has been removed from the translation files, so | ||
// it is not useable at run time. | ||
type FooBarTemplData struct { | ||
pantsTemplData | ||
Path string | ||
Reason error | ||
} | ||
|
||
// the ID should use spp/library specific code, so replace astrolib with the | ||
// name of the library implementing this template project. | ||
func (td FooBarTemplData) Message() *i18n.Message { | ||
return &i18n.Message{ | ||
ID: "foo-bar.astrolib.nav", | ||
Description: "Foo Bar description", | ||
Other: "foo bar failure '{{.Path}}' (reason: {{.Reason}})", | ||
} | ||
} | ||
|
||
// FooBarErrorBehaviourQuery used to query if an error is: | ||
// "Failed to read directory contents from the path specified" | ||
type FooBarErrorBehaviourQuery interface { | ||
FooBar() bool | ||
} | ||
|
||
type FooBarError struct { | ||
i18n.LocalisableError | ||
} | ||
|
||
// FooBar enables the client to check if error is FooBarError | ||
// via FooBarErrorBehaviourQuery | ||
func (e FooBarError) FooBar() bool { | ||
return true | ||
} | ||
|
||
// NewFooBarError creates a FooBarError | ||
func NewFooBarError(path string, reason error) FooBarError { | ||
return FooBarError{ | ||
LocalisableError: i18n.LocalisableError{ | ||
Data: FooBarTemplData{ | ||
Path: path, | ||
Reason: reason, | ||
}, | ||
}, | ||
} | ||
} | ||
// // ❌ FooBar | ||
|
||
// // FooBarTemplData - TODO: this is a none existent error that should be | ||
// // replaced by the client. Its just defined here to illustrate the pattern | ||
// // that should be used to implement i18n with extendio. Also note, | ||
// // that this message has been removed from the translation files, so | ||
// // it is not useable at run time. | ||
// type FooBarTemplData struct { | ||
// pantsTemplData | ||
// Path string | ||
// Reason error | ||
// } | ||
|
||
// // the ID should use spp/library specific code, so replace astrolib with the | ||
// // name of the library implementing this template project. | ||
// func (td FooBarTemplData) Message() *i18n.Message { | ||
// return &i18n.Message{ | ||
// ID: "foo-bar.astrolib.nav", | ||
// Description: "Foo Bar description", | ||
// Other: "foo bar failure '{{.Path}}' (reason: {{.Reason}})", | ||
// } | ||
// } | ||
|
||
// // FooBarErrorBehaviourQuery used to query if an error is: | ||
// // "Failed to read directory contents from the path specified" | ||
// type FooBarErrorBehaviourQuery interface { | ||
// FooBar() bool | ||
// } | ||
|
||
// type FooBarError struct { | ||
// i18n.LocalisableError | ||
// } | ||
|
||
// // FooBar enables the client to check if error is FooBarError | ||
// // via FooBarErrorBehaviourQuery | ||
// func (e FooBarError) FooBar() bool { | ||
// return true | ||
// } | ||
|
||
// // NewFooBarError creates a FooBarError | ||
// func NewFooBarError(path string, reason error) FooBarError { | ||
// return FooBarError{ | ||
// LocalisableError: i18n.LocalisableError{ | ||
// Data: FooBarTemplData{ | ||
// Path: path, | ||
// Reason: reason, | ||
// }, | ||
// }, | ||
// } | ||
// } |
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 was deleted.
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