if-else块有自己的范围。在您的情况下
dat,它们在外部不可见。
您可以
var dat []byte在
if (bundled == "true")修复前声明。
文件:https://golang.org/ref/spec#Declarations_and_scope
您可能还需要阅读:Go中的声明范围

if-else块有自己的范围。在您的情况下
dat,它们在外部不可见。
您可以
var dat []byte在
if (bundled == "true")修复前声明。
文件:https://golang.org/ref/spec#Declarations_and_scope
您可能还需要阅读:Go中的声明范围