Skip to content

Instantly share code, notes, and snippets.

@polds
Created June 10, 2015 23:27
Show Gist options
  • Select an option

  • Save polds/2f718e9360bf0df07933 to your computer and use it in GitHub Desktop.

Select an option

Save polds/2f718e9360bf0df07933 to your computer and use it in GitHub Desktop.
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)
}
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)
}
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