"Go 형용사 명사 생성기"의 두 판 사이의 차이

 
(같은 사용자의 중간 판 4개는 보이지 않습니다)
12번째 줄: 12번째 줄:


func main() {
func main() {
s, _ := sententia.Make("{{ adjective }}-{{ noun }}")
name, _ := sententia.Make("{{ adjective }}-{{ noun }}")
fmt.Println(s) // uncooked-playroom
fmt.Println(name) // 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>

2024년 5월 11일 (토) 13:45 기준 최신판

1 개요[ | ]

Go 형용사 명사 생성기
package main

import (
	"fmt"

	"github.com/castillobgr/sententia"
)

func main() {
	name, _ := sententia.Make("{{ adjective }}-{{ noun }}")
	fmt.Println(name) // uncooked-playroom
}
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
}

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}