How to initialize error type in if-else

前端 未结 2 2010
南旧
南旧 2021-02-12 09:42

In the code snippet below, how do I initialize an error variable?

err := nil                // can not compile, show \"use of untyped nil\"
if xxx {
    err = fu         


        
2条回答
提交回复
热议问题