Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've done something like this before:

> id = flag.Int64("id", -1, "ID of the thing I want")

Obviously that doesn't work for booleans, but you could take the boolean input as a string and then use strconv.ParseBool



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: