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

14번째 줄: 14번째 줄:
an, _ := sententia.Make("{{ adjective }}-{{ noun }}")
an, _ := sententia.Make("{{ adjective }}-{{ noun }}")
fmt.Println(an) // uncooked-playroom
fmt.Println(an) // uncooked-playroom
}
</syntaxhighlight>
<syntaxhighlight lang='go'>
package main
import (
"fmt"
"github.com/docker/docker/pkg/namesgenerator"
)
func main() {
fmt.Println(namesgenerator.GetRandomName(0)) // angry_rhodes
fmt.Println(namesgenerator.GetRandomName(1)) // stupefied_ardinghelli9
fmt.Println(namesgenerator.GetRandomName(3)) // epic_knuth5
fmt.Println(namesgenerator.GetRandomName(5)) // suspicious_heyrovsky8
}
}
</syntaxhighlight>
</syntaxhighlight>

2024년 5월 11일 (토) 13:44 판

1 개요

Go 형용사 명사 생성기
package main

import (
	"fmt"

	"github.com/castillobgr/sententia"
)

func main() {
	an, _ := sententia.Make("{{ adjective }}-{{ noun }}")
	fmt.Println(an) // uncooked-playroom
}
package main

import (
	"fmt"

	"github.com/docker/docker/pkg/namesgenerator"
)

func main() {
	fmt.Println(namesgenerator.GetRandomName(0)) // angry_rhodes
	fmt.Println(namesgenerator.GetRandomName(1)) // stupefied_ardinghelli9
	fmt.Println(namesgenerator.GetRandomName(3)) // epic_knuth5
	fmt.Println(namesgenerator.GetRandomName(5)) // suspicious_heyrovsky8
}

2 같이 보기

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