"Go Printf("%T")"의 두 판 사이의 차이

잔글 (Jmnote님이 Go fmt.Printf("%T") 문서를 Go Printf() %T 문서로 이동했습니다)
잔글 (Jmnote님이 Go Printf() %T 문서를 Go Printf("%T") 문서로 이동했습니다)
(차이 없음)

2023년 5월 27일 (토) 20:30 판

1 개요

Go Printf() %T
Go fmt.Printf("%T")
package main

import "fmt"

func main() {
	v := 42 // change me!
	fmt.Printf("v is of type %T\n", v)
}
package main

import "fmt"

func main() {
    fmt.Printf("%T\n", 123)     // int
    fmt.Printf("%T\n", 123.45)  // float64
    fmt.Printf("%T\n", "Hello") // string
    
    fmt.Printf("%T\n", byte(123))       // uint8
    fmt.Printf("%T\n", []byte("Hello")) // []uint8
    
    fmt.Printf("%T\n", true)  // bool
    fmt.Printf("%T\n", false) // bool
    fmt.Printf("%T\n", nil)   // <nil>
}

2 같이 보기

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