解决Golang中cannot refer to unexported name xxxx这类错误
在Golang中,碰到cannot refer to unexported name xxxx,这类错误,通常是你调用了一个包内不存在的函数导致的;
需要注意的是,包内的公共函数首字母必须是大写,而小写开头的函数都是私有函数,不能在包以外的地方调用,否则也会导致cannot refer to unexported name xxxx这类错误。
在Golang中,碰到cannot refer to unexported name xxxx,这类错误,通常是你调用了一个包内不存在的函数导致的;
需要注意的是,包内的公共函数首字母必须是大写,而小写开头的函数都是私有函数,不能在包以外的地方调用,否则也会导致cannot refer to unexported name xxxx这类错误。
原创内容,如需转载,请注明出处;
本文地址: https://www.perfcode.com/p/cannot-refer-to-unexported-name-xxxx.html
关注微信公众号,免费向我提问;