Created
January 14, 2014 09:07
-
-
Save polds/8415373 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 config | |
type Conf struct { | |
User, Password String | |
} |
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 ( | |
"test" | |
"config" | |
) | |
func main() { | |
conf := config.Conf{"Test", "Password1234"} | |
// How do I use conf here? | |
test.Run() | |
} | |
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 test | |
import ( | |
"config" | |
"fmt" | |
) | |
func (conf Conf) Run() { | |
fmt.Println(conf.User) | |
fmt.Println(conf.Password) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment