/usr/share/gocode/src/github.com/rakyll/statik/example/main.go is in golang-github-rakyll-statik-dev 0.1.1-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | //go:generate statik -src=./public
package main
import (
"log"
"net/http"
_ "github.com/rakyll/statik/example/statik"
"github.com/rakyll/statik/fs"
)
// Before buildling, run go generate.
// Then, run the main program and visit http://localhost:8080/public/hello.txt
func main() {
statikFS, err := fs.New()
if err != nil {
log.Fatalf(err.Error())
}
http.Handle("/public/", http.StripPrefix("/public/", http.FileServer(statikFS)))
http.ListenAndServe(":8080", nil)
}
|