refactor: export functions for parsing enum types
Alan Pearce alan@alanpearce.eu
Fri, 17 May 2024 12:22:14 +0200
2 files changed, 4 insertions(+), 4 deletions(-)
M internal/config/fetcher.go → internal/config/fetcher.go
@@ -28,7 +28,7 @@ return fmt.Sprintf("Fetcher(%d)", f) } -func parseFetcher(name string) (Fetcher, error) { +func ParseFetcher(name string) (Fetcher, error) { switch strcase.KebabCase(name) { case "channel": return Channel, nil @@ -43,7 +43,7 @@ } func (f *Fetcher) UnmarshalText(text []byte) error { var err error - *f, err = parseFetcher(string(text)) + *f, err = ParseFetcher(string(text)) return err }
M internal/config/importer-type.go → internal/config/importer-type.go
@@ -25,7 +25,7 @@ return fmt.Sprintf("Type(%d)", i) } -func parseType(name string) (ImporterType, error) { +func ParseImporterType(name string) (ImporterType, error) { switch strcase.KebabCase(name) { case "packages": return Packages, nil @@ -38,7 +38,7 @@ } func (i *ImporterType) UnmarshalText(text []byte) error { var err error - *i, err = parseType(string(text)) + *i, err = ParseImporterType(string(text)) return err }