Re: [go-nuts] circular package dependency between golang.org/x/mod and golang.org/x/tools

2023-12-20 Thread Nathan Lacey
xj...@gmail.com> wrote: > >> On Tue, Dec 19, 2023 at 9:37 PM Nathan Lacey >> wrote: >> >> > I noticed that we have a circular dependency between golang.org/x/mod >> and golang.org/x/tools >> > >> > golang.org/x/mod zip/zip_test.go incl

[go-nuts] circular package dependency between golang.org/x/mod and golang.org/x/tools

2023-12-19 Thread Nathan Lacey
I noticed that we have a circular dependency between golang.org/x/mod and golang.org/x/tools golang.org/x/mod zip/zip_test.go includes golang.org/x/tools I think we could get rid of the circular package dependency by changing that unit test to remove the dependency to tools/txtar . -- You re

Re: [go-nuts] Is this algorithm viable? its faster than AES256 upto 50KB

2022-08-02 Thread Nathan Fisher
urmur, CityHash, etc that aren't cryptographically secure but provide generally good hashing properties in terms of collision rate and performance. Cheers, Nathan On Tue, Aug 2, 2022 at 7:32 PM Alex Breadman wrote: > package mod > > import ( > "testing" > ) > > fu

Re: [go-nuts] Thread safe tree library?

2021-01-08 Thread Nathan Fisher
to have references available for further research? On Tue, Jan 5, 2021 at 20:15, K. Alex Mills wrote: > On Tue, Jan 5, 2021, 6:59 PM Nathan Fisher wrote: > >> Does write only locking provide read correctness? I would’ve thought >> based on the memory model it could cause i

Re: [go-nuts] Thread safe tree library?

2021-01-05 Thread Nathan Fisher
Does write only locking provide read correctness? I would’ve thought based on the memory model it could cause issues? https://golang.org/ref/mem#tmp_2 On Tue, Jan 5, 2021 at 19:40, K. Alex Mills wrote: > That is the simplest and most conservative way go about it, but ultimately > it depends on

[go-nuts] Any general VPN(pptp, l2tp, openVPN, IPSec VPN) server implementation in go?

2020-11-17 Thread Nathan
Hi, I want to use a general VPN protocols to comminucate with my server, we cannot change the client to use other VPN protocols. But I did a lot of research, it seems there is no go implementation for the general VPN. I really want that I'm wrong, so do any guys can give me some suggestion? Tha

Re: [go-nuts] import a file

2020-07-30 Thread Nathan Fisher
il.com?utm_medium=email&utm_source=footer> >> . >> > -- > 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

Re: [go-nuts] Re: Generics and parentheses

2020-07-17 Thread Nathan Bosscher
As others have mentioned, I'm still partial to angles to represent generics. e.g. func Method(input Type) I'm really glad you didn't go the round bracket method as that's super confusing in a method declaration. Squares aren't horrible, but I've always associated them with indexing/key lookups.

Re: [go-nuts] political fundraising on golang.org!

2020-06-15 Thread Nathan Fisher
To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/CA%2BYjuxu%3DYzT6mWA1EtThjf8rTjMfefGmfuzYw__0LwMou4W2wQ%40mail.gmail.com > <https://gro

Re: [go-nuts] Facebook web app and go?

2019-04-29 Thread Nathan Fisher
If you’re in AppEngine/GCP territory already there’s CloudDatastore (NoSQL), Blockstorage, and Memcache which used to all be available in their free tier. There’s emulators available in the gcloud tool kit that provides a reasonable local development experience. Cheers! Nathan On Mon, Apr 29

[go-nuts] Re: Should SIGTERM be included in the os package?

2019-04-16 Thread Nathan Fisher
ndard Go convention for variable names (e.g. Interrupt). Whereas the syscall package uses a convention more akin to C (e.g. SIGINT) presumably a result of auto-generation or legacy. On Tue, 16 Apr 2019 at 23:36, Nathan Fisher wrote: > Hello, > > Currently the *os* package defines the fol

[go-nuts] Should SIGTERM be included in the os package?

2019-04-16 Thread Nathan Fisher
While it's simple enough to add a var to my app it feels unnecessary for something that seems an increasingly common signal to handle. Thoughts? Kind regards, -- Nathan Fisher w: http://junctionbox.ca/ -- You received this message because you are subscribed to the Google Groups "

Re: [go-nuts] Forking/transfering a repository and import paths

2018-12-28 Thread Nathan Fisher
TLDR > Is it possible to fork a repo and change the import path of the repository? Not in one step with the github “click to fork”. You need to do one of the following: 1. Create a new empty remote repo, remap imports, and push to the new remote. 2. Fork, update imports, push. 3. Assuming vanity

Re: [go-nuts] Re: Go assembly interface calls

2018-12-15 Thread Nathan Fisher
One trick I’ve used when writing algorithms that use SSE is write it in Go first, run go build to output the assembler for the function, and then tweak the output manually. On Sat, Dec 15, 2018 at 09:36, Jason E. Aten wrote: > reflect.Method(i) and reflect.MethodByName("myFunc") have got to be fu

Re: [go-nuts] Go offline development recommendations

2018-12-13 Thread Nathan Fisher
We use dep at work and commit the vendor folder. The main benefit we see is that it ensures consistent builds across machines, tends to be faster, and allows offline development. assuming you don’t have to use a third party security or infrastructure team to download the dependencies. If you do the

Re: [go-nuts] Re: go language sensitive editor?

2018-11-23 Thread Nathan Fisher
Agree on this. Gorename and gofmt etc provide only a small subset of what is on GoLands roadmap. I toggle between vs code, vim(-go), and GoLand. There’s bits I like about all 3 but if I had to choose only one I’d probably go with GoLand. On Tue, Nov 20, 2018 at 20:24, robert engels wrote: > I us

[go-nuts] Re: Go 1.11.2 and Go 1.10.5 are released

2018-11-02 Thread Nathan Kerr
I updated my release related resources: - Go Release Timeline - When Should You Upgrade Go? On Friday, November 2, 2018 at 3:06:58 PM UTC-7, Andrew Bonventre wrote: > > Hello gophe

Re: [go-nuts] Heap of structs

2018-11-01 Thread Nathan Fisher
Is there a specific issue you’re experiencing in trying to implement it? Suggestions/observations: - export the struct (Str instead of str) if you’re exporting the Heap. - same for the fields in the struct unless you have a constructor function (eg New) and appropriate functions to modify/view th

Re: [go-nuts] Re: gomobile: what's the right way to make widgets?

2018-10-27 Thread Nathan Verrilli
be happy to use something that 'mostly works'. Neither case suggests that a cross-platform GUI is a useful addition to Go (and my own conclusion is that they show such a platform is not). Cheers, Nathan On 10/27/2018 7:34 AM, Gerald Henriksen wrote: An acceptable cross-platform GUI

Re: [go-nuts] Using a defer func() closure to call c.free

2018-10-11 Thread Nathan Davies
Ok, that's an interesting line of investigation - I'll take a look into that and let you know if I find anything. Thanks Nathan On Thu, 11 Oct 2018 at 13:04, Robert Engels wrote: > It is not necessarily the open doc that is freeing the memory, could be > the close doc as w

[go-nuts] [ANN] Get Programming with Go is now available in print

2018-09-18 Thread Nathan Youngman
the ebook and print versions, with international shipping available. Deal of the Day: https://yng.mn/dotd -- Nathan Youngman https://programminggo.com/ -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this grou

Re: [go-nuts] go1.11 no longer supports compressed hostnames in SRV lookup replies

2018-08-29 Thread Nathan Fisher
Can you share examples? On Wed, Aug 29, 2018 at 19:08, wrote: > We are using SRV records in Kubernetes for various purposes and Go 1.11 no > longer supports compressed names in SRV resource data ( > https://github.com/golang/net/commit/24dd3780ca4f75fed9f321890729414a4b5d3f13#diff-47e2241916c7047

[go-nuts] Re: Go 1.11 and 1.10.4 are Released

2018-08-24 Thread Nathan Kerr
I updated my release related resources: - Go Release Timeline - When Should You Upgrade Go? On Friday, August 24, 2018 at 3:24:25 PM UTC-7, Andrew Bonventre wrote: > > Hello goph

Re: [go-nuts] Ternary ... again

2018-08-15 Thread Nathan Youngman
onder what the author was feeling. Maybe the verbosity of Go isn't as "enjoyable" to read as your favourite language, but it is easy to understand. Nathan. https://yng.mn/programminggo On Wednesday, 15 August 2018 05:23:36 UTC-6, Mark Volkmann wrote: > > I realize I’m jus

[go-nuts] Re: Go 1.10.2 and Go 1.9.5 are released

2018-05-01 Thread Nathan Kerr
I updated my release related resources: - Go Release Timeline <https://pocketgophers.com/go-release-timeline/> - When Should You Upgrade Go? <https://pocketgophers.com/when-should-you-upgrade-go/> Nathan On Tuesday, May 1, 2018 at 10:04:38 AM UTC-7, Andrew Bonventre w

Re: [go-nuts] Re: Measure Memory Fragmentation

2018-04-28 Thread Nathan Fisher
Do you mean wrt to Go or more generally? I could see using a histogram with a logarithmic bucket size or similar. Where the bucket sizes are the maximum length in bytes a given “open slot” can hold and the count is the number of occurrences of that size in the pool. On Sat, Apr 28, 2018 at 6:18 PM

[go-nuts] Re: Go 1.10.1 and Go 1.9.5 are released

2018-03-29 Thread Nathan Kerr
I've updated my release related resources: - Go Release Timeline <https://pocketgophers.com/go-release-timeline/> - When Should You Upgrade Go? <https://pocketgophers.com/when-should-you-upgrade-go/> Nathan On Thursday, March 29, 2018 at 8:17:34 AM UTC-7, Andre

Re: [go-nuts] Flutter and golang

2018-03-10 Thread Nathan Fisher
Oh that’s awesome! I didn’t realise they were supporting desktop now. It sounded like it was abandoned in a push to focus on the mobile experience. On Sat, Mar 10, 2018 at 4:36 PM, Ged Wed wrote: > I used QT for 6 months and Flutter is way ahead. > QT has a huge licensing issue. You can only use

Re: [go-nuts] Re: [ANN] Get Programming with Go

2018-03-08 Thread Nathan Youngman
ked at http://www.gopl.io/ ? Nathan. On 8 March 2018 at 12:41, wrote: > > On Wednesday, 7 March 2018 10:46:58 UTC-4, Nathan Youngman wrote: >> >> Learn about error handling and concurrent state in the latest release of >> Get Programming with Go, available from Manning

Re: [go-nuts] Re: [ANN] Get Programming with Go

2018-03-07 Thread Nathan Youngman
e for the absolute beginner. Learning something like Scratch may be advisable first, to get the concepts down. Nathan. P.S. If you decide to buy a copy or recommend it to others, the discount code *39youngman* will give 39% off either the paper book or ebook. Also, my affiliate link earns me a fe

[go-nuts] [ANN] Get Programming with Go

2018-03-07 Thread Nathan Youngman
Learn about error handling and concurrent state in the latest release of Get Programming with Go, available from Manning Books. The first draft is complete. If you have any feedback, now’s the time to get it in, as we are currently editing the book before it goes to production. https://bit.l

[go-nuts] Re: How to merge labels along with json responses

2018-02-26 Thread Nathan Kerr
The general pattern for this is: 1. Create a data structure that reflects the JSON you want. 2. Fill it with data 3. Marshal or Encode Since you have an example of the JSON you want, putting it through one of the tools from Generating Go structs from JSON

Re: [go-nuts] Re: Go 1.10 is released

2018-02-19 Thread Nathan Kerr
I have also updated my release related resources: - Go Release Timeline - When Should You Upgrade Go? Enjoy! On Monday, February 19, 2018 at 6:17:18 AM UTC-7, Michel Casabianca

Re: [go-nuts] Re: Proposal: return if any not nil

2018-02-17 Thread Nathan Fisher
I think for me the benefit of a new statement is that it doesn't result in changes to existing formatting/behaviour. Rather it provides a familiar syntax and style semantic and results in no change to an existing code base (e.g. it's opt in). The problems I see with allowing 1 liner conditionals a

[go-nuts] Proposal: return if any not nil

2018-02-16 Thread Nathan Fisher
single return as follows; r, err := os.Open("blah.text") retnn nil, err I'm not wedded to the statement name retnn but more the general principle. Thoughts? Nathan -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To uns

[go-nuts] Re: [security] Go 1.8.7, Go 1.9.4, and Go 1.10rc2 are released

2018-02-07 Thread Nathan Kerr
I updated my release related resources with these releases: - When Should You Upgrade Go? <https://pocketgophers.com/when-should-you-upgrade-go/> - Go Release Timeline <https://pocketgophers.com/go-release-timeline/> Nathan On Wednesday, February 7, 2018 at 1:15:13 PM U

[go-nuts] net/http 404 error handling

2017-11-30 Thread Nathan Fisher
patibility. The main drawback I see to it would be a nil pointer check (in which case it could default to old behaviour). Thoughts? Kind regards, Nathan -- - sent from my mobile -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To u

[go-nuts] Re: Decode as JSON and store the JSON as blob in DB

2017-11-21 Thread Nathan Kerr
gion"` } `json:"contract"` } and type ServiceDB struct { ID string `db:"id"` Name string `db:"name"` Contract []byte `db:"contract"` } and convert between them as needed. Hope this helps, Nathan On Friday, November 17, 2017 at 8:31:

[go-nuts] [ANN] Pocket Gophers’ Guide to JSON - Early Access Special

2017-11-09 Thread Nathan Kerr
The Pocket Gophers’ Guide to JSON Learn how to confidently handle *any* JSON with the Pocket Gophers’ Guide to JSON. You’ll learn a universal approach to deal with any JSON that leverages encoding/json and other JSON tools in the Go ecosystem along wit

Re: [go-nuts] Memory leak when calling highly parallel goroutines

2017-10-26 Thread Nathan Kerr
Read Ways to limit concurrent resource use for different methods that can be used to limit concurrency along with example code. On Wednesday, October 25, 2017 at 9:05:44 PM UTC+2, Tamás Gulácsi wrote: > > Just blind shots: > resp.Body.Close(), >

[go-nuts] Re: Go 1.9.2 and Go 1.8.5 are released

2017-10-25 Thread Nathan Kerr
I updated my release related resources: - Go Release Timeline <https://pocketgophers.com/go-release-timeline/> - When Should You Upgrade Go? <https://pocketgophers.com/when-should-you-upgrade-go/> Nathan On Thursday, October 26, 2017 at 1:52:13 AM UTC+2, Chris Bro

Re: [go-nuts] repeatable builds

2017-10-19 Thread Nathan Kerr
Another option for 2 is https://github.com/cloudflare/hellogopher -- 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 mo

[go-nuts] Re: [security] Go 1.8.4 and Go 1.9.1 are released

2017-10-04 Thread Nathan Kerr
I updated my release related resources: - Go Release Timeline <https://pocketgophers.com/go-release-timeline/> - When Should You Upgrade Go? <https://pocketgophers.com/when-should-you-upgrade-go/> Hope the community finds them useful. Nathan On Wednesday, October 4, 2

[go-nuts] Re: Go 1.9 is released

2017-08-24 Thread Nathan Kerr
Congrats! I updated my Go Release Timeline and When Should You Upgrade Go? pages. On Friday, August 25, 2017 at 12:44:25 AM UTC+2, Chris Broadfoot wrote: > > Hello gophers, > > We just relea

[go-nuts] Re: Go eval the source

2017-07-25 Thread Nathan Kerr
I wrote an expanded explanation for the second option: Exploring alternatives with go run <https://pocketgophers.com/exploring-alternatives-with-go-run/>. On Saturday, July 22, 2017 at 4:13:27 PM UTC+2, Tong Sun wrote: > > Fabulous! Thanks Nathan! > > On Saturday, July 22,

[go-nuts] What is pprof overhead like when gathering a profile?

2017-07-24 Thread nathan
/blog/2017/03/13/profiling-and-optimizing-go-web-applications/ - suggests that "one of the biggest pprof advantages is that it has low overhead and can be used in a production environment on a live traffic without any noticeable performance penalties". Is that accurate? Thanks! Natha

[go-nuts] Re: How to determine when to actually use goroutines?

2017-07-24 Thread nathan
> I need to query a db to get its content type and then send the actually file that lives on the file system. Now the question is, should I put db.QueryRow and os.Open each in a goroutine to make them concurrent? Why make them concurrent if you need to know to know the end result of the DB call

[go-nuts] Re: Go eval the source

2017-07-21 Thread Nathan Kerr
A couple other options: 1. modify your code, compile, run 2. put most of your code in main.go, each specific sort method in a separate file (e.g., specific.go) so that go run main.go specific.go will use the sorting you need. See https://pocketgophers.com/10-to-instrument/ for an example of thi

Re: [go-nuts] Will cmd/compile/internal/gc be replaced in the future?

2017-07-19 Thread Nathan Kerr
The ones in the compiler were initially implemented in C. They were converted to Go for go1.5. The others were created to build tools in Go like gofmt. On Wednesday, July 19, 2017 at 5:54:13 PM UTC+2, Eddie Ringle wrote: > > It's not particularly likely that cmd/compile/internal/gc will be >> re

[go-nuts] Re: when has multi GOPATH, go can`t detect the vendor folder.

2017-07-18 Thread Nathan Kerr
By "has a vendor folder in it's root dir" do you mean /workspace/specific/project/vendor? If so, go didn't find it because that directory is outside of /workspace/specific/project/src/, and thus not seen as source files in the GOPATH. It works when the project is under /go because the vendor di

[go-nuts] Re: [Go2] toward-go2

2017-07-16 Thread Nathan Kerr
The active work for Go2 right now is gathering experience reports . Most of the changes resulting from these reports will land in Go1.x. It is expected that Go2 will only have a few major changes that will not be compatible with Go1. It is also possible

[go-nuts] Re: Iterate trough interface{} that stores map

2017-07-10 Thread Nathan Kerr
If you know what the map type is, use a type assertion: for k, v := range variable.(map[string]interface{}) { //... } If it could be one of several map types, use a type switch first. If you don't know anything about the map type, I don't know what you think you could do with it because you

[go-nuts] Re: display database table in html table like a gridview or dataview.

2017-07-06 Thread Nathan Kerr
For other readers of this thread: This was solved in Display database table in html table like gridview

[go-nuts] Re: Template func ParseFiles, parsing multiple files

2017-07-06 Thread Nathan Kerr
A text.Template contains one or more named templates. ParseFiles adds a new template to the collection with the filename as its name. Template names are used to tell Template.ExecuteTemplate which of the included templates to execute.

Re: [go-nuts] How to access pointer to pointer in cgo

2017-07-05 Thread Nathan Kerr
Did you assign something to the pointer? My guess is that you did not, because the code compiles and then fails at runtime telling the pointer is NULL. On Wednesday, July 5, 2017 at 1:19:47 PM UTC+2, Manohar Reddy wrote: > > > fmt.Println(optional._32.Magic) // did not work for me: HOW TO ACCESS

[go-nuts] Re: Calling OS X dylib from Go

2017-07-04 Thread Nathan Kerr
The default gc toolchain is fine. Use appropriate LDFLAGS or pkg-config directive in the import "C" comments. Then use the library like you would use any other library. See the libpng example in the cgo documentation . On Tuesday,

[go-nuts] Re: Go type chart

2017-07-02 Thread Nathan Kerr
Are you wanting something like https://github.com/gmarik/go-erd? On Saturday, July 1, 2017 at 8:19:27 PM UTC+2, Tong Sun wrote: > > Hi, > > Any exiting tools out there for Go type chart, to visualize the > relationships of different user defined Go types? Thx. > > > -- You received this messa

[go-nuts] Re: How do you create and use shared libraries in Go?

2017-06-26 Thread Nathan Kerr
Go packages are usually source code published in web-accessible repositories such as GitHub. The repositories for packages you want to use are checked out/cloned into GOPATH on your local machine using go get

[go-nuts] Re: How to Sync() a file?

2017-06-25 Thread Nathan Kerr
I assume that you mean by io.Copy not working correctly is that you expect the entire contents of File1.txt to be in File2.txt. This does not happen in your code (without reopening f1) because Files maintain an offset inside the file that remembers where the next operation should take place. Af

[go-nuts] Re: How can I make my own reader

2017-06-25 Thread Nathan Kerr
>From the docs : Read reads up to len(p) bytes into p. This lets the caller of Read manage the allocation and re-use of p. It also means your Read method has to work within the confines of whatever p you are given. If the data being read is larger than p, then the R

[go-nuts] Re: godoc shows methods where they're not defined

2017-06-25 Thread Nathan Kerr
Since *conn is embedded in DirectLob, its method sets are promoted to DirectLob's method sets. Since BeginTx is now part of DirectLob's method sets, it acts like any other member of the method sets would; in this case it is an exported method on DirectLob. This is a feature because it allows th

Re: [go-nuts] go build for mips

2017-06-22 Thread Nathan Kerr
What system are you building on (OS and architecture)? What version of Go are you using? Is the result of running go build an illegal instruction? What file did you provide information for? What is in hello.go? On Thursday, June 22, 2017 at 6:19:47 PM UTC+2, luc...@kryptus.com wrote: > > I try

[go-nuts] Re: XML decoder vs xpath Performance

2017-06-19 Thread Nathan Kerr
Hi, What is "best" depends on your exact situation. This includes the XML you receive, the specific values you need to extract, how much of the XML needs to be extracted, how much of the overall program the XML handling takes, the hardware the program runs on, and the development resources you

[go-nuts] Re: Is there any golang package available for building mongodb query from plain logic expression string or URL?

2017-06-05 Thread Nathan Kerr
I haven't tried it, but https://github.com/jhsx/qm might be useful. -- 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

[go-nuts] Re: did anyone tried // template exec ?

2017-05-30 Thread Nathan Kerr
I'm not aware of any templating languages that provide concurrent or parallel constructions. If you need parallel execution of those function calls, I would run the calls as part of my Go code and then pass the results to the template. On Tuesday, May 30, 2017 at 10:44:21 AM UTC+2, mhh...@gmail

Re: [go-nuts] Problem with HINDI NAMES

2017-05-25 Thread Nathan Kerr
The Go team knows this a problem (see the issues listed by Rob Pike). The difficultly in fixing it is that the ecosystem surrounding Go relies on the current definition for identifiers. There is no way to add the characters you need without breaking other tools like syntax highlighters. It is a

[go-nuts] Go 1.8.3 is released

2017-05-24 Thread Nathan Kerr
Thanks for the hard work. I updated my Go Release Timeline: https://pocketgophers.com/go-release-timeline/#go1.8.3 -- 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

[go-nuts] Re: [security] Go 1.7.6 and Go 1.8.2 are released

2017-05-23 Thread Nathan Kerr
I updated my Go Release Timeline with these updates: https://pocketgophers.com/go-release-timeline/#go1.8.2 On Tuesday, May 23, 2017 at 9:28:01 PM UTC+2, Chris Broadfoot wrote: > > A security-related issue was recently reported in Go's crypto/elliptic > package. > To address this issue, we have

[go-nuts] Re: Feedback welcome: "Shorten your URL"

2017-05-03 Thread Nathan Kerr
There are also responses here: Feedback Welcome: ‘Shorten your URL’ On Tuesday, May 2, 2017 at 9:32:45 AM UTC+2, Lutz Horn wrote: > > Hi Go Nuts, > > to practice my Go skills, I've implemented a simple w

[go-nuts] Fully-qualified import paths and Pull Requests

2017-05-02 Thread Nathan Kerr
http://blog.sgmansfield.com/2016/06/working-with-forks-in-go/ gives some good pointers on how to do this. -- 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-

[go-nuts] openid connect

2017-05-02 Thread Nathan Kerr
Try using https://github.com/markbates/goth -- 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 http

[go-nuts] Re: Dynamic type assertion for interface

2017-04-25 Thread Nathan Kerr
Thanks for providing code! What is CopyStruct intended to do? On Monday, April 24, 2017 at 6:33:58 PM UTC+2, Rajesh kumar wrote: > > Please do note that the structs in this example is a sample.My struct is > complex than this. > https://play.golang.org/p/_t7gx3javb > Here I have a function wher

Re: [go-nuts] Link documentation sources

2017-04-18 Thread Nathan Kerr
All the package documentation on https://golang.org/pkg and https://godoc.org is generated from the source. The headers for functions, types, etc. link to the source line where the function, type, etc. was defined. You can read more about godoc

[go-nuts] Re: http.Server handlers seem to stick around forever

2017-04-18 Thread Nathan Kerr
Instead of trying to restart the server, switch the handler: package main import ( "fmt" "io/ioutil" "log" "net/http" "strconv" ) // Some state so we can show the old handler is in effect... type Foo struct { SomeVar int } func (f *Foo) ServeHTTP(w http.ResponseWriter, r *http.Request) { fmt.Pr

[go-nuts] Re: Go 1.8.1 is released

2017-04-07 Thread Nathan Kerr
Thanks for all the hard work! I have updated my go release timeline visualization. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails

[go-nuts] Re: Error checking and defer

2017-03-16 Thread Nathan Kerr
I prefer to accept that multiple errors can occur. https://pocketgophers.com/handling-errors-in-defer/ -- 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-nut

Re: [go-nuts] Re: Conserving memory in TLS handshake and x509 certificate verification

2017-03-15 Thread Nathan Morley
> > What cgo calls were those? Are you using an alternative crypto > implentation? Sadly, I didn't save any of the metrics I gathered any more, so I can't say specifically what CGO calls were being used by my application. I do recall a good bit of the memory being spent on checking the certificat

[go-nuts] Re: Conserving memory in TLS handshake and x509 certificate verification

2017-03-15 Thread Nathan Morley
Problem resolved. Application was allocating a new http.Client for every remote call made, and since the handshake ultimately comes down to CGO calls, I was accumulating memory that was not managed by Go's GC. On Tuesday, March 14, 2017 at 8:21:58 PM UTC-4, Nathan Morley wrote: >

[go-nuts] Conserving memory in TLS handshake and x509 certificate verification

2017-03-14 Thread Nathan Morley
Hello, So I've written a small service in my free time that essentially pulls data from a RESTful API at a high rate, and store it in a database. While there is no rate limiting in place and I'm free to hit it as hard as I like with as many connections I need, I only have 5 workers going at a t

[go-nuts] Re: fsnotify: maintainers wanted

2017-03-14 Thread Nathan Youngman
I'm stepping away from the fsnotify project. Maintainers wanted: https://github.com/fsnotify/fsnotify/issues/183#issuecomment-286456045 Good luck, Nathan. On Tuesday, 25 October 2016 12:09:48 UTC-6, Nathan Youngman wrote: > > Hi, > > Fsnotify provides notifications of cha

Re: [go-nuts] Re: Understanding garbage collection in Go with infinite lists

2017-03-02 Thread Nathan Fisher
work" the memory leak would go away. Kind regards, Nathan On Fri, 3 Mar 2017 at 01:10 Yota Toyama wrote: Volker, I don't know if the term "memory leak" is misuse. But, the 1st version's memory usage is constant but the 2nd version's one grows over time as if nothin

[go-nuts] Re: NewTicker function example

2017-02-23 Thread Nathan Kerr
e end so the program will run forever. I am > trying to have it as a deamon. > > > > On Thursday, February 23, 2017 at 6:37:12 AM UTC-5, Nathan Kerr wrote: >> >> NewTicker function example >> >> The task of running functions on a periodic basis can be split into

Re: [go-nuts] Re: Trying to understand := and named return values

2017-02-23 Thread Nathan Kerr
They also seem to be the only way to handle errors in defer without panic or log.Fatal. On Wednesday, February 22, 2017 at 6:24:41 AM UTC+1, Paul Borman wrote: > > Named return values are perfectly fine, and I agree, probably should not > be

[go-nuts] Re: NewTicker function example

2017-02-23 Thread Nathan Kerr
NewTicker function example The task of running functions on a periodic basis can be split into two parts: timing and execution. A ticker solves the timing problem by providing a channel that get new input every period. Keeping the timing separate mitigates the impact of execution on the timing

[go-nuts] Re: unexpected end of JSON input while unmarshal to struct

2017-02-23 Thread Nathan Kerr
me. This is one of the hazards of implicit interfaces. On Thursday, February 23, 2017 at 2:48:22 AM UTC+1, Diogo Ribeiro wrote: > > Thanks Nathan, it worked. > I didn't know that *LimitOrder.UnmarshalJSON would call json.Unmarshal. > > Em terça-feira, 21 de fevereiro de 2

Re: [go-nuts] Initializing nested struct, by dynamically forming struct member path

2017-02-23 Thread Nathan Kerr
You gave two different things you want to accomplish: 1. “I am trying to read those values and store in DB” 2. “I will populate the struct and provide it the application for consumption” Fortunately accomplishing either or both of these goals follows a similar process. Start by figuring out wh

[go-nuts] Re: Import path search order?

2017-02-21 Thread Nathan Kerr
andard library is distributed as source. On Tuesday, February 21, 2017 at 5:51:10 PM UTC+1, so.q...@gmail.com wrote: > > Thanks! > > what do you mean by "from left to right"? > And by GOROOT, you mean it looks at the go source? > > > > On Tuesday, February 21,

Re: [go-nuts] Initializing nested struct, by dynamically forming struct member path

2017-02-21 Thread Nathan Kerr
Could you give an example of the json you are starting from? Also, what database are you using? On Sunday, February 19, 2017 at 8:27:32 AM UTC+1, Bharath B wrote: > > Hi, > > I am trying to read those values and store in DB. > > Regards, > Bharath B > -- You received this message because you ar

[go-nuts] Re: Import path search order?

2017-02-21 Thread Nathan Kerr
Relative package don't need to be searched for, they are explicit (indicated with ./ or ../) Then it seems to be: 1. vendor tree, if it exists 2. GOROOT 3. GOPATH, from left to right Trying to build a package with an import that cannot be found will display an error listing all the locations i

[go-nuts] Re: unexpected end of JSON input while unmarshal to struct

2017-02-21 Thread Nathan Kerr
I figured it out. First off, the posted playground had a different json string and did not use your UnmarshalJSON function. These made translating between the non-working setup described in your post and the working playground annoying. In the future, share the non-working setup. At the point

[go-nuts] Re: Registering a Go app as a protocol handler under Mac OS X

2017-02-20 Thread Nathan Kerr
ton on the window. This seems to be a limit of the ui package. This worked for me using go1.8 on macOS 10.12.3 and the latest version of the ui package. Hope it helps you out. Nathan On Wednesday, July 6, 2016 at 11:50:02 PM UTC+2, chris...@gmail.com wrote: > > Hi, > > I'm trying

Re: [go-nuts] Re: fmt: Why Golang doesn't have fmt.Printlnf?

2017-02-07 Thread Nathan Fisher
I would speculate it's a conscious tradeoff to keep the function count low given it's an equivalent number of characters. On Wed, 8 Feb 2017 at 03:32, 高橋誠二 wrote: > yes, I know but other languages support it as default, isn't it? > > 2017年2月8日水曜日 12時31分00秒 UTC+9 dja...@gmail.com: > > > > On Wedne

[go-nuts] Re: Reading an .ini file

2017-01-16 Thread Nathan Kerr
Do you have a better suggestion? On Tuesday, January 17, 2017 at 3:52:49 AM UTC+1, hui zhang wrote: > > this package is quit buggy > check its issues, I list some , and still not fix yet > > 在 2017年1月15日星期日 UTC+8上午1:43:55,Nathan Kerr写道: >> >> Using a newer pack

[go-nuts] Reading an .ini file

2017-01-14 Thread Nathan Kerr
Using a newer package might help. https://github.com/go-ini/ini looks to be under active development and is written by the author of https://github.com/Unknwon/goconfig, which also reads ini files but is now in bug fix only mode. Both claim to support comments. -- You received this message be

[go-nuts] Re: How to know the listener

2017-01-10 Thread Nathan Kerr
RemoteAddr was completely blank for me. This may be because I am running macOS. The important part is that the different contents of RemoteAddr indicates that the request came from tcp or unix. Dave Cheney's suggestion of skipping the auth for the unix listener is probably a better solution. -

[go-nuts] Re: How to know the listener

2017-01-10 Thread Nathan Kerr
nix-socket unix://`pwd`/tmp_socket: from https://github.com/Soulou/curl-unix-socket to test the unix socket. Hopefully my server is similar to what you had. If not, please post some code. Cheers, Nathan On Tuesday, January 10, 2017 at 3:23:30 PM UTC+1, hawk hsieh wrote: > > I open a po

[go-nuts] Documenting Interfaces

2017-01-09 Thread Nathan Morley
Hey all, I have a brief question on the "best practices" for documenting Go code. I did a quick sweep through the official blog as well as the Effective Go article, but found no answer as of yet... Let's say I have an interface like a database driver that gets implemented in multiple places. W

Re: [go-nuts] Re: type assertion: Can I DRY this up?

2016-11-01 Thread Nathan Fisher
I guess it becomes a question of what operations you want to do on the data. If you look at the implementation of the Json package and sort interface it might provide you with some approaches to achieve what you want. Json demonstrates reflection, sort demonstrates how to invert the problem in a wa

[go-nuts] fsnotify: maintainers wanted

2016-10-25 Thread Nathan Youngman
tps://github.com/fsnotify/fsnotify/issues/183 Thanks, Nathan. -- 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

[go-nuts] Re: How to setup go-swagger for an existing project to generate API docs

2016-10-20 Thread Nathan Kerr
I just tried this out and discovered that an operationId is required for swagger:route: // swagger:route GET /profile getProfile tags go between the path and the operationId: // swagger:route GET /profile tag1 tag2 getProfile Hope this helps. On Monday, October 17, 2016 at 7:01:52 AM UTC+2,

  1   2   >