M shared/config/config.go →
shared/config/config.go *url.URL
}
-func NewURL(rawURL string) URL {
- u, err := url.Parse(rawURL)
- if err != nil {
- panic(err)
- }
-
- return URL{u}
-}
-
-func (u *URL) UnmarshalText(text []byte) (err error) {
- u.URL, err = url.Parse(string(text))
-
- return fault.Wrap(err, fmsg.With(fmt.Sprintf("could not parse URL %s", string(text))))
-}
-
type Timezone struct {
*time.Location
-}
-
-func (t *Timezone) UnmarshalText(text []byte) (err error) {
- t.Location, err = time.LoadLocation(string(text))
-
- return fault.Wrap(err, fmsg.With(fmt.Sprintf("could not parse timezone %s", string(text))))
}
type GoPackagesConfig struct {
RelMe []MenuItem `toml:"rel_me"`
Go GoPackagesConfig
+}
+
+func NewURL(rawURL string) URL {
+ u, err := url.Parse(rawURL)
+ if err != nil {
+ panic(err)
+ }
+
+ return URL{u}
+}
+
+func (u *URL) UnmarshalText(text []byte) (err error) {
+ u.URL, err = url.Parse(string(text))
+
+ return fault.Wrap(err, fmsg.With(fmt.Sprintf("could not parse URL %s", string(text))))
+}
+
+func (t *Timezone) UnmarshalText(text []byte) (err error) {
+ t.Location, err = time.LoadLocation(string(text))
+
+ return fault.Wrap(err, fmsg.With(fmt.Sprintf("could not parse timezone %s", string(text))))
}
func GetConfig(dir string, log *log.Logger) (*Config, error) {