2020-03-18
If you’re using glog in your Go codes, you can output those when running go test … by using the –args parameter: $ go test -v ./… -count=1 -cover -race -mod=vendor –args –logtostderr –v=1
1 minute
Using glog together with cobra in golang
2017-12-01
If you have been programming with golang, you’ve probably heard of cobra. I use it extensively at work and also in my personal projects. Recently though, I’ve been using glog more and more. And I quite like it. The thing is, it has a couple of flag definitions in its init() function using golang’s builtin flag library. And I wanted to include those flags into cobra’s flag definitions. This is how I did it.
2 minutes