-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sso-{auth,proxy}: adding version flag #139
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,11 +11,19 @@ import ( | |
"github.com/kelseyhightower/envconfig" | ||
) | ||
|
||
var goVersion string | ||
|
||
func init() { | ||
log.SetServiceName("sso-authenticator") | ||
} | ||
|
||
func main() { | ||
if len(os.Args) > 1 && os.Args[1] == "version" { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to see this as an actual command line flag (i.e. |
||
fmt.Println(auth.VERSION) | ||
fmt.Println(goVersion) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aesthetic and nit-picky, but my preference for this would be:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd just like to reiterate my request in #36 (comment) that the app version and go version be split across two lines for easier tooling. In my (fairly limited) experience, the thing that matters when building automation is the app version, and it's a bit annoying to have to do extra work to split it out from the go version. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ahh, sorry I missed that in the original issue. I get it, and can probably get over my distaste. I feel like you would still have to parse it, e.g. by grabbing just the first line of output, but yea, that is easier. |
||
os.Exit(1) | ||
} | ||
|
||
logger := log.NewLogEntry() | ||
|
||
opts := auth.NewOptions() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go has a
runtime.Version()
func in the standard library that we can use instead of passing a variable externally into the build process.