You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. http.Get(anyurl) (or anything which uses Dial)
2. compile
3. run
What is the expected output? What do you see instead?
I expect a nil error
But I get:
Error Get http://data.keolis-rennes.com/xml/: dial tcp
data.keolis-rennes.com:http: lookup data.keolis-rennes.com.: no DNS servers
What is your $GOOS? $GOARCH?
GOOS=linux
GOARCH=386
GOROOT=/local/go
Which revision are you using? (hg identify)
ef7417009743 tip
Please provide any additional information below.
All the other programs (dig, ping, wget) work fine with this
resolv.conf.But Go, instead of using the OS routines, implements its own
name resolution logic which fails if the /etc/resolv.conf does not have a
new line at the end.
If I add a new line to resolv.conf, it is OK again.
The text was updated successfully, but these errors were encountered:
The function getLineFromData line 22 in the file parse.go
is explicitely checking for a newline, and will not return anything for a line that
is not ended by a newline.
I think that adding:
if len(data) > 0 {
s = string(data[0:len(data)]);
ok=true;
}
before the for loop should fix the issue, but I lack time to make the tests right now.
func (f *file) getLineFromData() (s string, ok bool) {
data := f.data
for i := 0; i < len(data); i++ {
if data[i] == '\n' {
by bortzmeyer:
The text was updated successfully, but these errors were encountered: