-
-
Save polds/2f718e9360bf0df07933 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 a | |
| import ( | |
| "fmt" | |
| ) | |
| type A string | |
| var AS A = New() | |
| func init() { | |
| AS = "Init String" | |
| } | |
| func New() A { | |
| return "New String" | |
| } | |
| func (a A) Something(msg string) string { | |
| return fmt.Sprint(a, msg) | |
| } |
This file contains hidden or 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 b | |
| import ( | |
| "fmt" | |
| "playground/init_process/a" | |
| ) | |
| var ( | |
| One = a.AS.Something("One") | |
| Two = a.AS.Something("Two") | |
| ) | |
| func ATest() { | |
| fmt.Println(One) | |
| fmt.Println(Two) | |
| } |
This file contains hidden or 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 ( | |
| "playground/init_process/b" | |
| ) | |
| func main() { | |
| b.ATest() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment