MCPcopy Create free account
hub / github.com/cronitorio/cronitor-cli / GetEnvVarValue

Method GetEnvVarValue

lib/crontab.go:780–789  ·  view source on GitHub ↗

GetEnvVarValue extracts the value from an environment variable line

()

Source from the content-addressed store, hash-verified

778
779// GetEnvVarValue extracts the value from an environment variable line
780func (l Line) GetEnvVarValue() string {
781 if !l.IsEnvVar() {
782 return ""
783 }
784 parts := strings.SplitN(l.FullLine, "=", 2)
785 if len(parts) > 1 {
786 return strings.TrimSpace(parts[1])
787 }
788 return ""
789}
790
791func createAutoDiscoverLine(crontab *Crontab) *Line {
792 cronExpression := fmt.Sprintf("%d * * * *", randomMinute())

Callers 1

MarshalJSONMethod · 0.95

Calls 1

IsEnvVarMethod · 0.95

Tested by

no test coverage detected