New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net/http: get does not work #24970
Comments
I get a more descriptive error from this code. https://play.golang.org/p/_f2geOmnMzl
Also, the Go project does not use its bug tracker for general discussion or asking questions. The Github bug tracker is only used for tracking bugs and proposals going through the Proposal Process. Please see the Questions wiki page; it has a list of good places for asking questions. Thanks! |
Closing per:
|
I was thinking how to categorize this. This wasn't technically a question per-se. OP raised an issue which wasn't working in his system. While it was clear that this cannot be a bug in Go because of the simplicity of the issue, I think it warranted a bit more than simply closing it. |
But same code works fine on linux OS. |
@yyq2013 I'm not seeing this work on Go 1.10.1 in a docker image. With or without modifying
|
@adamdecaf my linux: [root@iZ2zef032vfaf0fdq8tcbuZ src]# cat test.go import ( func main() {
} |
@yyq2013 Your example had it removed when you posted originally. |
@adamdecaf maybe, I was updating it then |
@yyq2013 - It seems like a system specific issue to me. Do you have access to another windows system ? Can you do a |
@agnivade It's strange, on another win10 it works. |
Sorry, there has to be an path for -O. Try |
I just tested your sample (with DefaultClient commented out as well as not commented), and got back the entire web page correctly both times. I think maybe the original code was just missing the scheme as @adamdecaf mentioned. |
I found the reason, there is a global socks5 proxy on my win10 OS, the default transport use it by default. Sorry for wasting your time, everyone here. Please close it. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?C:\WINDOWS\system32>go version
go version go1.10.1 windows/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?win10 64bit
C:\WINDOWS\system32>go env
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Administrator\AppData\Local\go-build
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\Administrator\go
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\ADMINI~1\AppData\Local\Temp\go-build873199622=/tmp/go-build -gno-record-gcc-switches
What did you do?
http.Get(url) doesn't work with default transport, if I set a custom it works fine like following:
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
What did you expect to see?
Print the html content
What did you see instead?
There is an error with less meaning.
Get https://www.github.com/: unexpected EOF
The text was updated successfully, but these errors were encountered: