I'm learning Go web server programming and have copied the following 
example:


func Image(w http.ResponseWriter, r *http.Request) {
    f, _ := os.Open("images/my.png")
    . . . 


It works fine when I'm starting the Go web server with `go run main.go &`. 
I.e., the file "images/my.png" is related to where I started "go run". 
However, it won't be the case when the Go web server is compiled and 
started the other way. 

What's the proper way to make sure it always works, including starting from 
docker container? 

THX!




-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to