I am very new to programming in general let alone Go... currently I have been experimenting serving some content via HTTP, and [for reasons] I have a string that I want to store in a separate package, and serve it back to my main project via a function call. however I am getting an error (in various forms depending on how I change the code up):
"mismatched types string and func() string"
here is the 'data' package
package encodedjs
var base64EncodedJS string
func ReadEncodedJS() string {
return base64EncodedJS
}
func init() {
base64EncodedJS = "data:text/javascript;base64,largestring_blah_blah_blah=="
}
...then the main code calling it
package main
import (
"./encodedjs"
)
func main() {
js := "some text to simply show one way I've tried" + encodedjs.ReadEncodedJS
}