Very odd error, go api works with curl and bruno but not javascript fetch

ANSWER:

It was a cors error from the browser sending preflight request with a method of options. The browser does not show that in the network tab.
Using debugger in vscode helped

I was able to fix it with following snippet:

		if req.Method == "OPTIONS" {
			w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE")
			w.Header().Set("Access-Control-Allow-Headers", "Content-Type, Origin, Accept, token")
			w.WriteHeader(http.StatusOK)
			return
		}