최신판 |
당신의 편집 |
12번째 줄: |
12번째 줄: |
|
| |
|
| func main() { | | func main() { |
| name, _ := sententia.Make("{{ adjective }}-{{ noun }}") | | s, _ := sententia.Make("{{ adjective }}-{{ noun }}") |
| fmt.Println(name) // uncooked-playroom | | fmt.Println(s) // uncooked-playroom |
| }
| |
| </syntaxhighlight>
| |
| <syntaxhighlight lang='go' run>
| |
| package main
| |
| | |
| import (
| |
| "fmt"
| |
| | |
| "github.com/docker/docker/pkg/namesgenerator"
| |
| )
| |
| | |
| func main() {
| |
| fmt.Println(namesgenerator.GetRandomName(0)) // interesting_pascal
| |
| fmt.Println(namesgenerator.GetRandomName(1)) // eloquent_panini3
| |
| fmt.Println(namesgenerator.GetRandomName(3)) // focused_mclaren8
| |
| fmt.Println(namesgenerator.GetRandomName(5)) // frosty_lederberg4
| |
| } | | } |
| </syntaxhighlight> | | </syntaxhighlight> |