{"id":2640,"date":"2020-07-18T22:57:11","date_gmt":"2020-07-18T17:27:11","guid":{"rendered":"https:\/\/golangbyexamples.com\/?p=2640"},"modified":"2020-07-18T22:57:22","modified_gmt":"2020-07-18T17:27:22","slug":"zero-value-of-interface-go","status":"publish","type":"post","link":"https:\/\/golangbyexamples.com\/zero-value-of-interface-go\/","title":{"rendered":"Zero Value of Interface in Go (Golang)"},"content":{"rendered":"\n
Default or zero value of an interface is nil. Below program demonstrates that<\/p>\n\n\n\n
package main\n\nimport \"fmt\"\ntype animal interface {\n breathe()\n walk()\n}\n\nfunc main() {\n var a animal\n fmt.Println(a)\n}<\/code><\/pre>\n\n\n\nOutput<\/strong><\/p>\n\n\n\nnil<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"Default or zero value of an interface is nil. Below program demonstrates that Output<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[1],"tags":[3,4],"class_list":["post-2640","post","type-post","status-publish","format-standard","hentry","category-tech","tag-go","tag-golang"],"yoast_head":"\n
Zero Value of Interface in Go (Golang) - Welcome To Golang By Example<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n