MCPcopy Index your code
hub / github.com/dnote/dnote / requireString

Function requireString

pkg/server/cmd/helpers.go:106–112  ·  view source on GitHub ↗

requireString validates that a required string flag is not empty

(fs *flag.FlagSet, value, fieldName string)

Source from the content-addressed store, hash-verified

104
105// requireString validates that a required string flag is not empty
106func requireString(fs *flag.FlagSet, value, fieldName string) {
107 if value == "" {
108 fmt.Printf("Error: %s is required\n", fieldName)
109 fs.Usage()
110 os.Exit(1)
111 }
112}
113
114// createApp creates config, initializes app, and returns cleanup function
115func createApp(fs *flag.FlagSet, dbPath string) (*app.App, func()) {

Callers 3

userCreateCmdFunction · 0.85
userRemoveCmdFunction · 0.85
userResetPasswordCmdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected