Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save padurean/2fe263929c2886b30650760e85a67e57 to your computer and use it in GitHub Desktop.
Save padurean/2fe263929c2886b30650760e85a67e57 to your computer and use it in GitHub Desktop.
// Example of how third-party imports and multiple files can be used in Go playground
package main
import (
"fmt"
"github.com/common-nighthawk/go-figure"
"your.universe/worlds"
)
func main() {
worldOf := worlds.WorldOf("GoT")
myFigure := figure.NewFigure(fmt.Sprintf("Hello, %s!", worldOf), "", true)
myFigure.Print()
}
-- go.mod --
module your.universe
-- worlds/world.go --
package worlds
import "fmt"
func WorldOf(name string) string {
return fmt.Sprintf("World of %s", name)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment