Created
March 22, 2017 00:56
-
-
Save trevoro/780409c9970611c7a97efc32def41876 to your computer and use it in GitHub Desktop.
This file contains 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 ( | |
"fmt" | |
"os" | |
) | |
type config struct { | |
V string | |
X string | |
} | |
func (c *config) isValid() bool { | |
if c.X == "" { | |
return false | |
} | |
if c.V == "" { | |
return false | |
} | |
return true | |
} | |
func main() { | |
c := config{ | |
os.Getenv("TEST1"), | |
os.Getenv("TEST2"), | |
} | |
fmt.Println(c.isValid()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment