How to set Home page and static files in same path

if I run the URL http://localhost:8080/ I want to run the Index function and If I run http://localhost:8080/robot.txt it should show static folder files func main() { http.HandleFunc("/", Index) http.Handle("/", http.StripPrefix("/", http.FileServer(http.Dir("static")))) http.ListenAndServe(":8080", nil) } func Index(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "Index") } How to do this. Currently, I’m getting this error panic: http:… Read More How to set Home page and static files in same path