"K8s.io/utils/ptr"의 두 판 사이의 차이

 
(차이 없음)

2024년 5월 10일 (금) 15:05 기준 최신판

1 개요[ | ]

k8s.io/utils/ptr
package main

import (
	"fmt"

	"k8s.io/utils/ptr"
)

func main() {
	var s string = "Hello, world!"
	var p *string = ptr.To[string](s)
	fmt.Println(*p) // Hello, world!
	fmt.Println(p)  // 0xc00008e040
}

2 같이 보기[ | ]

3 참고[ | ]

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