in the code snippet below which is inside a function, is "defer
resp.Body.Close() " in the appropriate position?
am i required to always do a resp.Body.Close()?
...
resp, err := client.Do(req)
log.Printf("resp: %+v\n", resp)
if resp.StatusCode != http.StatusOK {
return errors.NewHTTPErr
Defer defers the esecutiin of the following expression, but not the evaluation
of the arguments.
So "defer fn(a==1)" will call fn when this function exists, with a bool that is
true iff a _was_ 1 when the defer was registered.
--
You received this message because you are subscribed to the Googl
thanks! seems to be working out for me too so far. makes me wonder what the
use cases might be for sql.NullXYZ and other similar types from non-stdlib
packages other than making the connection to db nulls more obvious maybe?
On Saturday, January 27, 2018 at 10:12:23 PM UTC+8, Reinhard Luediger w
On Saturday, 27 January 2018 23:49:19 UTC+2, Pat Farrell wrote:
>
>
>
> On Saturday, January 27, 2018 at 4:34:39 PM UTC-5, Lars Seipel wrote:
>>
>> We're talking about a beginning Go programmer that has yet to learn how
>> some of the more advanced parts of the language fit together properly.
>
example :
fn := func() {
fmt.Println(10)
}
defer fn()
my question is why use defer fn() not defer fn
when we use fn() here doesn't it mean call it now ???
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and
Hi Keith,
Can you share some specific things you’d like to see already implemented?
Serving JSON data and web pages to a browser seems like a straightforward
project with the standard library examples and resources available with
Internet search engines.
Here’s an official net/http server walk
>
> Interesting. Does this work on all browsers on all platforms?
Untested here. I've seen it work on macOS with Safari, Chrome, and Firefox.
The || is to support how different browsers indicate a back button press /
back cache load.
Matt
On Saturday, January 27, 2018 at 3:49:19 PM UTC-6, P
I flushed the cache and now see the correct output on
https://play.golang.org/p/-MKUWeDBml7
On Sat, Jan 27, 2018 at 4:42 PM Andrew Bonventre
wrote:
> Looks like it. I’ll check it out.
> On Sat, Jan 27, 2018 at 3:20 PM Ian Lance Taylor wrote:
>
>> [ +andybons, bradfitz ]
>>
>> Looks like someth
On Sat, Jan 27, 2018 at 1:44 AM, Serhat Şevki Dinçer wrote:
>
> On Manjaro 64-bit with go 1.9.3 I am doing:
> go install -gcflags '-B -s' -ldflags '-s -w' -buildmode shared std
>
> I get two warnings many times:
> go/src/unicode/casetables.go:17:11: redundant type: CaseRange
> go/src/vendor/golang
On Saturday, January 27, 2018 at 4:34:39 PM UTC-5, Lars Seipel wrote:
>
> We're talking about a beginning Go programmer that has yet to learn how
> some of the more advanced parts of the language fit together properly.
Sorry, no. Folks coming from other languages want to know how to do the
u
Looks like it. I’ll check it out.
On Sat, Jan 27, 2018 at 3:20 PM Ian Lance Taylor wrote:
> [ +andybons, bradfitz ]
>
> Looks like something has gone wrong with the play.golang.org caching.
>
> Ian
>
> On Sat, Jan 27, 2018 at 10:18 AM, wrote:
> > I see the same thing. Changing even one characte
On Thu, Jan 25, 2018 at 01:26:00PM -0800, Florin Pățan wrote:
> I'm not saying that we should be against recommending the standard library,
> by all means, it's one of the best assets of the language. But maybe it's
> time we should think about saying: Start with this framework, insert
> framewo
[ +andybons, bradfitz ]
Looks like something has gone wrong with the play.golang.org caching.
Ian
On Sat, Jan 27, 2018 at 10:18 AM, wrote:
> I see the same thing. Changing even one character fixes the problem. Even
> just adding white space to the code. If I copy the example from
> https://gol
syscall.Stat_t does have the Dev field, which is documented by POSIX:
https://linux.die.net/man/2/stat: "The st_dev field describes the device on
which this file resides. (The major(3) and minor(3) macros may be useful to
decompose the device ID in this field.)"
In Go we don't have the major and m
Just to say that neugram.io has also a Jupyter front-end. Here's an example
with 'my' high energy physics oriented libraries and Gonum:
https://mybinder.org/v2/gh/go-hep/binder/master
Now, Go has 3 Jupyter kernels :)
-s
sent from my droid
On Jan 27, 2018 8:18 PM, "Matt Harden" wrote:
> That'
That's very nice!
On Wed, Jan 17, 2018 at 8:29 AM Glen Newton wrote:
> Wow! This is great and positions Go better in the 'data science' world!
>
> Thanks,
> Glen
>
>
> On Tuesday, January 16, 2018 at 8:53:39 AM UTC-5, Yu Watanabe wrote:
>>
>> Hi Gophers,
>>
>> I developed a new Go's Jupyter Note
A couple of comments.
This is probably obvious, but I wanted to point out that matthe...'s code
would require *all *access to the map to be synchronized using the mutex.
It's a simple and effective solution. One downside to his code is that it
holds the lock for the duration of the Copy(). Thi
It isn't something that is likely to be added to the stdlib. If anything, a
library like https://github.com/Logicalis/asn1 might be interested in
supporting it / accepting a pull request to add it.
On Fri, Jan 12, 2018 at 9:50 AM David Wahlstedt <
david.wahlstedt@gmail.com> wrote:
> ASN.1 is
I see the same thing. Changing even one character fixes the problem. Even
just adding white space to the code. If I copy the example from
https://golang.org/ to the playground exactly (
https://play.golang.org/p/-MKUWeDBml7 ) it also prints nothing.
Strange
On Saturday, January 27, 2018 at 5:
On Thursday, January 25, 2018 at 8:38:01 PM UTC-5, matthe...@gmail.com
wrote:
>
> Specific question: how do you handle the user hitting the "back" button on
>> their browser? Its very common and a lot of simple approaches don't handle
>> it well.
>
>
> This was a problem for me. I force the pa
Sure, that's possible. I will check and see how to implement it
properly.
Regards,
Dario Castañé
dario.im[1]
On Sat, Jan 27, 2018, at 13:34, anmol via golang-nuts wrote:
> What do you think about offering a second variant to allow passing
> in the http server? It's possible one may want to set l
Hi Jeeva,
Thanks for sharing go-resty here. I’d like to mention that my input about
struct embedding may not be valid. It was pointed out to me previously when
I made a similar suggestion that in library design embedding exports all of
the embedded type’s methods, so you may have those named fi
For me it works perfect when I just define each nullable field as a pointer in
the struct which represents a da base record. If the struct field is nil it
will be null in the database and json encoding handles these fields also
correctly
--
You received this message because you are subscribed
I'm having a problem building an ios framework that depends on a OpenGL
library.
if this is the file:
package gfx
import (
"github.com/goxjs/gl"
)
func test() {
gl.Clear(gl.COLOR_BUFFER_BIT)
}
This is the build output:
gomobile bind -target=ios
gomobile: go install
-pkgdir=/Users/johnt
What do you think about offering a second variant to allow passing in the
http server? It's possible one may want to set limits or other
configuration on the HTTP server instead of using the default http server.
On Thursday, January 25, 2018 at 6:42:03 PM UTC-5, Dario Castañé wrote:
>
> I'm plea
Hello.
I have db connect open before run ssh command. But after run ssh command db
connect will be disconnect
Is there anyway to fix it.
Thanks you very much.
Tuan
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group
Of course, that was I already did. But I talk about the log into function I
want to test (in the example of playground: func IsBuggyEven) .
see:
https://play.golang.org/p/OWnEntLwfXa
check 0 is even or odd, but I want see this log only for fail test case
(i.e when i == 5)
check 2 is even or o
When I "Run", can't see the proper output, just "Program exited".
Only after changing "Hello World" to another example and then back to
"Hello World" I see the right output:
Hello, 世界 Program exited.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" gr
Hi,
On Manjaro 64-bit with go 1.9.3 I am doing:
go install -gcflags '-B -s' -ldflags '-s -w' -buildmode shared std
I get two warnings many times:
go/src/unicode/casetables.go:17:11: redundant type: CaseRange
go/src/vendor/golang_org/x/net/http2/hpack/tables.go:131:13: redundant
type: HeaderField
Use subtest (t.Run)
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/
30 matches
Mail list logo