Logo
Explore Help
Register Sign In
Katenary/katenary
2
0
Fork 0
You've already forked katenary
Code Issues 7 Pull Requests Actions Packages Projects Releases 15 Wiki Activity
Files
master
katenary/internal/generator/labels/labelstructs/secrets.go

14 lines
250 B
Go
Raw Permalink Normal View History

chore(convention): Respect Go convention, package name should be lowercase
2025-07-06 14:34:16 +02:00
package labelstructs
Use real types to parse labels We were using `yaml.Unmarshal` on basic types or inline structs. This was not efficient and not clear to defined what we expect in labels. We now use types to unmarshal the labels. Only the `values` label is, at this time, parsed by GetValuesFromLabel because this `utils` function is clearly a special case.
2024-04-24 23:06:45 +02:00
import "gopkg.in/yaml.v3"
type Secrets []string
func SecretsFrom(data string) (Secrets, error) {
var mapping Secrets
if err := yaml.Unmarshal([]byte(data), &mapping); err != nil {
return nil, err
}
return mapping, nil
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.5 Page: 696ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API