"Go UUID 생성"의 두 판 사이의 차이

(새 문서: ==개요== ;Go UUID 생성 <syntaxhighlight lang='go' run> package main import ( "fmt" "github.com/google/uuid" ) func main() { newUUID := uuid.New() fmt.Println(newUUID.Strin...)
 
 
12번째 줄: 12번째 줄:


func main() {
func main() {
newUUID := uuid.New()
newUUID := uuid.New().String()
fmt.Println(newUUID.String()) // 27707c42-a1c5-4179-8c7e-effcd1a4b61c
fmt.Println(newUUID)     // 27707c42-a1c5-4179-8c7e-effcd1a4b61c
fmt.Println(len(newUUID)) // 36
}
}
</syntaxhighlight>
</syntaxhighlight>

2024년 7월 3일 (수) 23:39 기준 최신판

1 개요[ | ]

Go UUID 생성
package main

import (
	"fmt"

	"github.com/google/uuid"
)

func main() {
	newUUID := uuid.New().String()
	fmt.Println(newUUID)      // 27707c42-a1c5-4179-8c7e-effcd1a4b61c
	fmt.Println(len(newUUID)) // 36
}

2 같이 보기[ | ]

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