Version returns the version of the config, defaulting to the latest "3.x" version (3.13). If only the major version "3" is specified, it is used as version "3.x" and returns the default version (latest 3.x).
(config map[string]any)
| 55 | // version (3.13). If only the major version "3" is specified, it is used as |
| 56 | // version "3.x" and returns the default version (latest 3.x). |
| 57 | func Version(config map[string]any) string { |
| 58 | version, ok := config[versionField] |
| 59 | if !ok { |
| 60 | return defaultVersion |
| 61 | } |
| 62 | return normalizeVersion(fmt.Sprintf("%v", version)) |
| 63 | } |
| 64 | |
| 65 | func normalizeVersion(version string) string { |
| 66 | switch version { |
nothing calls this directly
no test coverage detected
searching dependent graphs…