Fix

"http: server gave HTTP response to HTTPS client"

Web
Fix the 'http: server gave HTTP response to HTTPS client' error by setting GODEBUG=http2client=0 to disable HTTP/2.

The error occurs because your Go HTTP client is attempting to use HTTP/2 over an unencrypted connection, which the server rejects. Set the GODEBUG environment variable to http2client=0 to force the client to use HTTP/1.1.

export GODEBUG=http2client=0

Alternatively, run your command with the variable prefixed:

GODEBUG=http2client=0 go run main.go