Go 빈 인터페이스 interface{}

(Go interface{}에서 넘어옴)

1 개요[ | ]

Go interface{}
Go empty interface
Go 빈 인터페이스
// https://tour.golang.org/methods/14
package main

import "fmt"

func main() {
	var i interface{}
	describe(i)

	i = 42
	describe(i)

	i = "hello"
	describe(i)
}

func describe(i interface{}) {
	fmt.Printf("(%v, %T)\n", i, i)
}

2 같이 보기[ | ]

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