Skip to content
This repository has been archived by the owner on Feb 5, 2021. It is now read-only.

Commit

Permalink
fix Yoda style warning of staticcheck.io
Browse files Browse the repository at this point in the history
  • Loading branch information
François Kooman committed Nov 8, 2019
1 parent 92d1bc9 commit df53cc8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vpn-ca/main.go
Expand Up @@ -174,7 +174,7 @@ func main() {
return
}

if "" == *serverCommonName && "" == *clientCommonName {
if *serverCommonName == "" && *clientCommonName == "" {
flag.Usage()
os.Exit(1)
}
Expand All @@ -184,7 +184,7 @@ func main() {
// determine whether the user specified an "-not-after" flag and parse it
// if they did...
var notAfterTime time.Time
if "" != *notAfter {
if *notAfter != "" {
p, err := time.Parse(time.RFC3339, *notAfter)
fatalIfErr(err, "unable to parse -not-after")
if !p.After(time.Now()) {
Expand All @@ -193,7 +193,7 @@ func main() {
notAfterTime = p
}

if "" != *serverCommonName {
if *serverCommonName != "" {
validateCommonName(*serverCommonName)
if notAfterTime.IsZero() {
// if no "-not-after" flag was specifed, we expire the server cert
Expand All @@ -204,7 +204,7 @@ func main() {
return
}

if "" != *clientCommonName {
if *clientCommonName != "" {
validateCommonName(*clientCommonName)
if notAfterTime.IsZero() {
notAfterTime = time.Now().AddDate(0, 0, 90)
Expand Down

0 comments on commit df53cc8

Please sign in to comment.