Created
June 12, 2021 01:19
-
-
Save oscarzhou/1eab1f20806f2a0988c566467041f16e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
) | |
type Profile struct { | |
Name string | |
Age uint | |
Verified bool | |
} | |
func main() { | |
var version string | |
var profile Profile // new added | |
flag.StringVar(&version, "setVersion", "1.0.0", "") | |
flag.Var(&profile, "setProfile", "") // new added | |
flag.Parse() | |
fmt.Println("version = ", version) | |
fmt.Println("profile = ", profile) // new added | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment