When trying to change the static content information set in the toml file to one using environment variables error question that occurred
Put the corresponding code first
// .env variables
STATICS=[["web", "/var/www/ichain-admin-react"],["static", "static"]]
// source code
func serveStaticFiles(engine *gin.Engine) {
statics := os.Getenv("STATICS")
for i := 0; i < len(statics); i++ {
url, root := statics[i][0], statics[i][1]
if !path.IsAbs(root) {
root = path.Join(config.ExecutedPath, root)
}
engine.Static(url, root)
}
}
invalid operation: cannot index statics[i] (value of type byte)
I didn't find any articles that would help me much
Thank you