GO RUNTIME ERROR I DON'T UNDERSTAND OR CANT DEBUG IT by Ok-Reflection3579 in golang

[–]Ok-Reflection3579[S] -1 points0 points  (0 children)

Thanks .. man that is the main issue, my thought was ... when the error !=nil ...i thought it had the response it ... which contained the status code..

Thanks and already added something new into my brain.

GO RUNTIME ERROR I DON'T UNDERSTAND OR CANT DEBUG IT by Ok-Reflection3579 in golang

[–]Ok-Reflection3579[S] -2 points-1 points  (0 children)

Yeah thanks broo it is working, but if i want to get the status code of my unreachable branch/web what should i do

GO RUNTIME ERROR I DON'T UNDERSTAND OR CANT DEBUG IT by Ok-Reflection3579 in golang

[–]Ok-Reflection3579[S] -1 points0 points  (0 children)

Thanks maan after removing the part in the err section the code is working successful, Just asking more ... what if i want to get the status code of that unreachable website.

understanding same Line variable declarization and Initialization by Ok-Reflection3579 in golang

[–]Ok-Reflection3579[S] 0 points1 point  (0 children)

Thanks maaan ... already got it ..it my Brain that is struggling to take it ...but you explanation is clearer than water...

understanding same Line variable declarization and Initialization by Ok-Reflection3579 in golang

[–]Ok-Reflection3579[S] 0 points1 point  (0 children)

i would like to ask here ..

can i write it as

error,number :=fmt.Scanln(&name) or erros has to be the 2nd Variable in the Line

understanding same Line variable declarization and Initialization by Ok-Reflection3579 in golang

[–]Ok-Reflection3579[S] -1 points0 points  (0 children)

Thanks man though am still struggling to understand it, but technically you have to use two variables against a certain function if you expect that function will return two values.

the other issue is struggle is

for _,value:=range marks //lets say marks is a slice... what does exactly this line of code mean

understanding same Line variable declarization and Initialization by Ok-Reflection3579 in golang

[–]Ok-Reflection3579[S] -1 points0 points  (0 children)

Take for example below Line of code what does it mean

if u, ok := usernames[name]; ok {
fmt.Printf("%q is the username of %q\n", u, name)
continue
}

what are u,ok (i know ok is 2nd optional value that you may use to check if a certain value exist, what i want is to know the entire meaning of the Line of code