?
On Tuesday, March 20, 2018 at 11:26:18 AM UTC-7, Alex Efros wrote:
>
> Hi!
>
> On Tue, Mar 20, 2018 at 10:37:40AM -0700, st ov wrote:
> > json.Unmarshal(resp.Body, )
>
> This one is invalid.
>
> > json.NewDecoder(resp.Body).Decode()
> >
> >
For JSON responses, is it more appropriate to use
json.Unmarshal(resp.Body, )
or
json.NewDecoder(resp.Body).Decode()
or
b, _ := ioutil.ReadAll(resp.Body)
json.Unmarshal(b, )
What are the uses for each?
Does this differ from how you would read non-JSON responses?
--
You received this
Sunday, October 15, 2017 at 11:36:36 PM UTC+3, st ov wrote:
>>
>> A value sent through a channel can be read by only one reader, so once
>> its read its no longer available to other readers is that right?
>>
>> In what ways can I pass/communicate/distribute a value thro
A value sent through a channel can be read by only one reader, so once its
read its no longer available to other readers is that right?
In what ways can I pass/communicate/distribute a value through a channel
and have it shared across an unknown number of readers?
--
You received this message
I'm not seeing dep ensure the transitive dependencies of my vendored
packages.
How do I ensure that all dependencies are downloaded?
--
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
Don't know, hope @Dave Cheney will be able to answer that.
On Monday, September 4, 2017 at 6:03:18 PM UTC-7, chou wrote:
>
> I want to buy one, is it released out?
>
> 在 2017年9月5日星期二 UTC+8上午7:41:36,st ov写道:
>>
>> Any information on the contents and a release date?
>>
Thanks!
On Tuesday, September 5, 2017 at 2:14:07 AM UTC-7, Peter Waller wrote:
>
> On 5 September 2017 at 06:35, Volker Dobler > wrote:
>
>> A "test binary" is a normal binary compiled by go test including the test
>> function
>> from the *_test.go files which executes
And how do they differ from normal binaries?
--
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
Any information on the contents and a release date?
Couldn't find any details on O'reilly, Amazon or dave.cheney.net.
--
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
How do you add pprof to a custom ServeMux?
https://golang.org/pkg/net/http/#ServeMux
Its my understanding that the following import only adds handlers to the
default mux.
import _ "net/http/pprof"
--
You received this message because you are subscribed to the Google Groups
"golang-nuts"
It's recommended to add pprof to servers
import _ "net/http/pprof"
Is this true even for publicly exposed servers? How do you limit access?
How useful is pprof for clusters since it only profiles a single server?
--
You received this message because you are subscribed to the Google Groups
Thanks for the suggestions, but that framework is for mocking a server
right?
What if what I want to test is a server and endpoints I developed?
On Friday, July 21, 2017 at 1:24:23 AM UTC-7, Simon Ritchie wrote:
>
> My scaffolding tool generates a web server and some unit and integration
>
Thats a great resource, thank you!
Also does the htttptest.Server mock out a server so that you can test
clients?
What if I want to test my own server?
On Wednesday, July 19, 2017 at 10:07:44 AM UTC-7, Jérôme LAFORGE wrote:
>
> One of my favorite resource can be found here about testing
When creating a simple server using http.Server and http.ServeMux, how do
you test it?
What do you do for unit tests? integration tests?
Do you mock requests to each handler and check the response? How?
How do you test peformance and requests per second?
--
You received this message because
:47:14 AM UTC-7, Peter Mogensen wrote:
>
>
>
> On 2017-06-26 09:37, st ov wrote:
> > Ruby has Gems and .NET has DLLs.
> > How do you package and share libraries in Go?
>
> Gems are mainly source files, right? ... Using
> source libraries in Go is relatively strai
Ruby has Gems and .NET has DLLs.
How do you package and share libraries in Go?
--
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
as 100%
> compatibility. So far, compatibility issues have been no problem *for me*,
> but I can only speak for myself.
>
>
> On 25. Jun 2017, at 20:16, st ov <so.q...@gmail.com > wrote:
>
> Could you go into a bit more detail on how you would setup a local docker
>
robably use Docker
> for that.
>
> Advantages of using Go within a Docker container:
>
> * No accidental mixing of Go versions
> * No multi-GOPATH hassle
> * Can be removed cleanly when not needed anymore.
>
> On Saturday, June 24, 2017 at 10:12:38 PM UTC+2, st ov wr
Do you use gvm? https://github.com/moovweb/gvm
Is there a simpler way?
How do you avoid conflicts with Homebrew? Should I not run 'brew install
go'?
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop
Go appears to be very strict when using types. Even aliases need to be
explicitly cast.
Are there any contexts where types are implicitly cast? Or must all type
conversions be specified?
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To
Most examples of opening and closing a file have both calls in the same
function
func DoFileStuff() {
file, _ := os.Open("file")
defer file.Close()
// do stuff with file
}
This makes sure any open file is closed.
But how common is it to separate that logic into functions?
Should this be
Thanks yet again for clarifying and correcting my assumptions.
So within a single package tests are run serially, but I can't rely on that
when testing multiple packages.
On Sunday, May 7, 2017 at 8:04:52 PM UTC-7, Dave Cheney wrote:
>
> The post over on stack overflow is confused. The
Go test methods run in separate goroutines but those routines are run
serially right?
So variable assignments shouldn't get stomped by other tests?
I saw a comment saying they're *concurrent*, but not *parallel* by default.
Thanks for correcting my concerns!
On Thursday, May 4, 2017 at 8:52:02 PM UTC-7, Dave Cheney wrote:
>
>
>
> On Friday, 5 May 2017 13:37:26 UTC+10, st ov wrote:
>>
>> By "fork" I mean in the GItHub sense, the forking of original project
>> *github.com/orig
By "fork" I mean in the GItHub sense, the forking of original project
*github.com/original/foo* through their console so that *github.com/me/foo*
is created.
And "clone" would be running "git clone
https://github.com/original/foo.git; on my local machine so I have a local
copy of the original
Should the source repo be cloned or forked first? Or does it not matter?
I was thinking there could be an issue with someone pushing a change after
its cloned but before its forked.
On Tuesday, May 2, 2017 at 11:55:41 PM UTC-7, Nathan Kerr wrote:
>
>
On Wednesday, May 3, 2017 at 7:33:49 AM UTC-7, st ov wrote:
>
> Thanks, if I read that right the post just rehashes the workflow for
> working with remotes with git and go get.
>
> The question I have concerns the import path in the code.
>
> If I fork, *github.com/origina
Thanks, if I read that right the post just rehashes the workflow for
working with remotes with git and go get.
The question I have concerns the import path in the code.
If I fork, *github.com/original/foo*
clone it locally to, *github.com/me/foo*
Add *github.com/me/foo/internal/bar/bar.go* and
How should import paths be handled with regard to pull requests?
For example, I fork a project and add an internal package.
Convention says I should use the fully-qualified import path in my own
project.
When creating a pull request this import path would need to be updated to
point to the
amazing, Thank you for that detailed breakdown!
On Friday, April 21, 2017 at 10:08:02 AM UTC-7, Jesper Louis Andersen wrote:
>
> On Fri, Apr 21, 2017 at 5:58 PM st ov <so.q...@gmail.com >
> wrote:
>
>> @Jesper, curious how you determined that?
>> Is
Thank you Ian for providing those details and for pointing me to the code
in the source to reference. I'll have a look and respond back if I have any
questions.
On Friday, April 21, 2017 at 1:18:22 PM UTC-7, Ian Lance Taylor wrote:
>
> On Fri, Apr 21, 2017 at 12:37 PM, st ov
Thanks for the confirmation and advice!
On Friday, April 21, 2017 at 1:29:02 PM UTC-7, Alan Donovan wrote:
>
> On 21 April 2017 at 15:26, st ov <so.q...@gmail.com > wrote:
>>
>> When deciding between method receivers, any advice on how to choose which
>> to use?
&
-7, Ian Lance Taylor wrote:
>
> On Fri, Apr 21, 2017 at 9:30 AM, st ov <so.q...@gmail.com >
> wrote:
> > Is it not possible? The doc seems to say that 'go test' recompiles each
> > package tested
> > https://golang.org/cmd/go/#hdr-Test_packages
>
> `go t
Is it not possible? The doc seems to say that 'go test' recompiles each
package tested
https://golang.org/cmd/go/#hdr-Test_packages
On Thursday, April 20, 2017 at 10:00:24 AM UTC-7, st ov wrote:
>
> As part of a build pipeline, I want to initially artifact the Go binary to
> send th
In general, is it advisable to return pointers to newly constructed
instances when using constructors?
Would it matter more for types that don't have members of composite types
slice and maps?
So in the following example, https://play.golang.org/p/sWTWkHfZfB
Bar is made up of mostly strings,
@Jesper, curious how you determined that?
Is it in the spec? or the source?
Or is this a common GC pattern that you presume is being used?
On Thursday, April 20, 2017 at 7:01:03 AM UTC-7, Jesper Louis Andersen
wrote:
>
> A somewhat common culprit seems to be the following case:
>
> 1. In
As part of a build pipeline, I want to initially artifact the Go binary to
send through all the stages from development to production.
How can I run a set of tests (*_test.go) against this one binary? Can I
only have blackbox tests or is whitebox possible?
Or will the approach need to be, to
ead to field
> result.
>
> There is a data race on rpc.result
>
> On Sunday, April 2, 2017 at 11:57:59 PM UTC+2, st ov wrote:
>>
>> Could you explain how this is a race condition?
>> Running it in the playground appears to succeed,
>> https://play.golang.org/p
I read everything is pass-by-value in Go, is that correct?
What does it encompass? Are there any exceptions?
Does that mean the following:
int passes full integer byte value
float64 passes full float byte value
string passes full string []byte value
slice passes pointer value to slice in memory
receivers, as seen here:
> https://dave.cheney.net/2015/11/18/wednesday-pop-quiz-spot-the-race
>
>
> On Friday, March 24, 2017 at 6:20:06 PM UTC-7, st ov wrote:
>>
>> Is it idiomatic to mix-&-match pointer and value method receivers for a
>> given type?
>> or in
Is it idiomatic to mix-&-match pointer and value method receivers for a
given type?
or in *general*, if a single method requires a pointer receiver than *all
methods* should take a pointer, regardless if a value receiver is
appropriate?
For example, should Foo.SetVal also be a pointer
just a thought experiment :)
On Monday, March 13, 2017 at 12:20:57 AM UTC-7, Jan Mercl wrote:
>
> On Mon, Mar 13, 2017 at 8:05 AM st ov <so.q...@gmail.com >
> wrote:
>
> > I know it can be accessed the question relates to this
> >
> http://stackoverflow.
itself
> as usual, no reflect needed.
>
> On Mon, Mar 13, 2017, 01:37 st ov <so.q...@gmail.com > wrote:
>
>> Thanks!
>> anyway to get a reference to that new array without using reflect?
>>
>>
>>
>>
>> On Sunday, March 12, 2017 at 12:13:03 PM
Thanks!
anyway to get a reference to that new array without using reflect?
On Sunday, March 12, 2017 at 12:13:03 PM UTC-7, Jan Mercl wrote:
>
> On Sunday, March 12, 2017 at 11:49:33 AM UTC-7, st ov wrote:
>
> > What happens when appending to a slice exceeds the b
:33 AM UTC-7, st ov wrote:
>
> What happens when appending to a slice exceeds the backing capacity?
>
> https://play.golang.org/p/mVezWL4Cbe
>
> In the example given, appending within capacity on line 20 modifies the
> backing array at the successive index.
> But on line 26
What happens when appending to a slice exceeds the backing capacity?
https://play.golang.org/p/mVezWL4Cbe
In the example given, appending within capacity on line 20 modifies the
backing array at the successive index.
But on line 26, when appending exceeds the capacity, the backing array is
no
Oh I see, so I need to treat all the elements as individual requests and
specifically handle each. Thanks!
On Thursday, March 9, 2017 at 12:59:13 AM UTC-8, Axel Wagner wrote:
>
> By writing the corresponding code :) For example:
>
> package main
>
> import (
> "log"
> "net/http"
> )
>
> func
47 matches
Mail list logo