Re: [go-nuts] [ANN] GoLand 2019.1 is out

2019-03-27 Thread Sameer Ajmani
Nice update! Great to see debugging and diagnostics built into the IDE. On Wed, Mar 27, 2019 at 10:59 AM Florin Pățan wrote: > Hello gophers, > > > I'm happy to let you know that we just released GoLand 2019.1. > > Here are a few things you can find in this release: > >- Built-in Profiler

Re: [go-nuts] Question regarding gob

2019-03-25 Thread Sameer Ajmani
on hiatus) right now? > > On Monday, March 25, 2019 at 10:36:12 PM UTC+8, Sameer Ajmani wrote: >> >> With gRPC, I recommend you use protobuf. >> >> On Mon, Mar 25, 2019 at 8:18 AM Glen Huang wrote: >> >>> I planed to use net/rpc with gob, but then found th

Re: [go-nuts] Question regarding gob

2019-03-25 Thread Sameer Ajmani
With gRPC, I recommend you use protobuf. On Mon, Mar 25, 2019 at 8:18 AM Glen Huang wrote: > I planed to use net/rpc with gob, but then found the GitHub issue saying > net/rpc is deprecated, and people should be using grpc instead. > > That leads to the question should I use grpc with gob or

Re: [go-nuts] goreadme - automate Github Go projects readme files.

2019-03-11 Thread Sameer Ajmani
Any of the above :-) On Mon, Mar 11, 2019 at 1:13 PM Eyal wrote: > > > On Sunday, March 10, 2019 at 12:10:23 AM UTC+2, Sameer Ajmani wrote: >> >> Very nice. As a point of interest, I wrote something similar for Go >> packages inside Google called "writeme&quo

Re: [go-nuts] goreadme - automate Github Go projects readme files.

2019-03-09 Thread Sameer Ajmani
Very nice. As a point of interest, I wrote something similar for Go packages inside Google called "writeme". It worked with multiple languages (the ones used inside Google), but had to be run manually. Your hook integration is much nicer! Have you thought about how module information might be

Re: [go-nuts] I found a very strange code that would cause deadlocks and blocking,why???

2019-02-28 Thread Sameer Ajmani
The deadlock happens because the channel is empty, so the receive operation blocks forever. The second version imports a package that may start new goroutines in its init functions. If so, those goroutines may not be deadlocked, but the main function is still blocked on the receive operation. It

Re: [go-nuts] if/switch statements as expressions

2018-12-22 Thread Sameer Ajmani
Inline functions can meet this need, though there's usually a better way: v := func() T { if b { return v1 } return v2 }() On Sat, Dec 22, 2018 at 2:05 PM Viktor Kojouharov wrote: > I've used kotlin extensively, where ifs and switches are expressions. I've > also seen rust support them.

Re: [go-nuts] Package Stutter

2018-12-01 Thread Sameer Ajmani
For what it's worth, we considered various ways to shorten context.Context before releasing it as open source. The obvious choice would be context.C, but I was concerned this would encourage people to name their context variables c, which conflicts with the common short name for channel variables.

Re: [go-nuts] gosnip: run small snippets of Go code from the command line

2018-11-25 Thread Sameer Ajmani
Instead of writing your own logic to resolve missing imports, could you run the goimports tool? It will automatically select imports from the standard library and GOPATH. S On Sat, Nov 24, 2018 at 5:06 PM Ben Hoyt wrote: > I just finished a little tool called "gosnip" that allows you to run >

Re: [go-nuts] goimports performance degrades in go module

2018-11-08 Thread Sameer Ajmani
+Tools team 30 seconds is much too slow for a tool that's used as a save hook. Ideally we're closer to 100ms; half a second is OK. Do we have a workaround for goimports+go.mod until the latency issues are resolved? Thanks, S On Wed, Nov 7, 2018 at 7:43 PM Joseph Lorenzini wrote: > > > Hi all,

Re: [go-nuts] Golang, how dare you handle my checks! (Critique of error proposal)

2018-09-21 Thread Sameer Ajmani
That's quite an interesting wiki page, thanks for sharing. On Thu, Sep 13, 2018 at 2:46 PM Liam Breck wrote: > The contents of the feedback wiki are interesting. The Go 2 error proposal > hasn't seen much support, and there are lots of counter-proposals... > >

Re: [go-nuts] modules and package cyclic dips

2018-09-16 Thread Sameer Ajmani
Hi Scott, thanks for boiling this down to the specific behavior you're looking for. Is there a specific feature request you'd like to make for this? If so, please file it in golang.org/issue. Thanks! S On Sun, Sep 16, 2018 at 4:01 PM Scott Cotton wrote: > Hi all, > > I just ran a test and

Re: [go-nuts] Perf : Multithreaded goroutines files I/O

2018-09-16 Thread Sameer Ajmani
Yes, Go can do concurrent file I/O. You might try using the execution tracer to see whether you're getting the parallelism you expect. There's a tutorial here: https://blog.gopheracademy.com/advent-2017/go-execution-tracer/ You might also check out my blog post on constructing parallel goroutine

Re: [go-nuts] modules and package cyclic dips

2018-09-15 Thread Sameer Ajmani
;>> confusing? I would have found so at least. >>>> >>>> Cycles crossing major versions may be more problematic. >>>> >>>> similarly in the case of coordinating a collection of modules, >>>> dependency cycles may lead unintentionally to

Re: [go-nuts] modules and package cyclic dips

2018-09-14 Thread Sameer Ajmani
Scott > > On 10 September 2018 at 04:25, Sameer Ajmani wrote: > >> I think there's a disconnection between how you and I understand this >> system works. In a given build, there is only a single version of a module; >> there cannot be multiple copies, let alone many co

Re: [go-nuts] modules and package cyclic dips

2018-09-09 Thread Sameer Ajmani
ecification or vision, and maybe, (even hopefully) I am wrong about > these concerns. > > I could list more related ideas, but given that I might be wrong I'll > leave it at that. > > Thanks, > > Scott > > > On 9 September 2018 at 19:19, Sameer Ajmani wrote: >

Re: [go-nuts] modules and package cyclic dips

2018-09-09 Thread Sameer Ajmani
as backward in time self dependencies. > > Scott > > > > On 9 September 2018 at 18:38, Sameer Ajmani wrote: > >> With respect to errors, I'm asking how things failed when you had a >> cyclic module dependency. My expectation is that this should just work. If >

Re: [go-nuts] modules and package cyclic dips

2018-09-09 Thread Sameer Ajmani
s too much thought that > I'd rather spend on the code. > > For example, I don't want to think what will happen to some SCC in a > module dependency graph after > a decade of development, in particular if a module can depend on an > earlier version of itself. > > Scott > >

Re: [go-nuts] modules and package cyclic dips

2018-09-09 Thread Sameer Ajmani
Are you seeing errors when there are cyclic module dependencies? As I recall, cyclic dependencies between modules (not packages) must be allowed: https://research.swtch.com/vgo-mvs "Note that F 1.1 requires G 1.1, but G 1.1 also requires F 1.1. Declaring this kind of cycle can be important when

Re: [go-nuts] Coming to Go (from Java / Scala / Clojure).

2018-08-31 Thread Sameer Ajmani
I'm glad to hear you're enjoying Go! Thanks for the article. Others have written their stories, too; I found this wiki page recently that focuses on stories about migrating codebases to Go from other languages: https://github.com/golang/go/wiki/FromXToGo On Thu, Aug 30, 2018 at 8:03 AM Akram Ahmad

Re: [go-nuts] Re: IDE/tools that support the new Go module feature in 1.11?

2018-08-25 Thread Sameer Ajmani
+Ian C, Alan, Rebecca, Michael On the Go team are working with tool owners to migrate tools to the new go/packages API, which adds module support and compatibility with older workspaces. On Sat, Aug 25, 2018 at 6:22 AM Diego Bernardes wrote: > gometalinter and gotests are breaking for me. They

Re: [go-nuts] Delve 1.1.0 is released

2018-08-16 Thread Sameer Ajmani
Congrats! Lots of new DWARF improvements in Go 1.11; thanks for working with us to make these great! On Thu, Aug 16, 2018 at 7:02 PM Derek Parker wrote: > Announcing Delve v1.1.0! > Tons of fixes and improvements including: * Go 1.11 support * Initial > support for function & method calls (still

Re: [go-nuts] Go not exists as Technology in Google Developers Experts

2018-08-05 Thread Sameer Ajmani
Very good question! I'll follow up on this, thank you. On Sun, Aug 5, 2018 at 7:56 AM Davor Kapša wrote: > Why Go not listed ? > > https://developers.google.com/experts/all/technology > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To

Re: [go-nuts] Re: context.C and context.BG

2017-11-18 Thread Sameer Ajmani
Context.TODO and Background have different String values; see emptyCtx.String. On Fri, Nov 17, 2017 at 9:25 PM me via golang-nuts < golang-nuts@googlegroups.com> wrote: > I've found a hint. Apparently, both context.TODO and context.Background > share a common implementation but they need distinct

Re: [go-nuts] Google Cloud Golang SDK authentication

2017-11-18 Thread Sameer Ajmani
+Ross and Jonathan On Sat, Nov 18, 2017 at 1:26 AM SALMAN AHMED wrote: > I am trying to automate the VM and Network resource creation using GCD > Client API. I do not want to use Google OAuth as the user has to generate > token every time. I used AWS SDK and it can

Re: [go-nuts] Re: How to learn golang web development

2017-10-14 Thread Sameer Ajmani
There's also a Udemy course: https://www.udemy.com/go-programming-language/ On Sat, Oct 14, 2017 at 6:12 AM Simon Ritchie wrote: > > Not a book, but a simple working example. > > My scaffolder tool generates a web server in source code from a > specification. > >

Re: [go-nuts] Expiring map

2017-07-20 Thread Sameer Ajmani
We have a few implementations of this inside Google (expiring.Map, timedcache, and lru.Cache). It might make sense to open source these, if they have no internal dependencies. On Wed, Jul 19, 2017 at 3:22 PM Rajanikanth Jammalamadaka < rajanika...@gmail.com> wrote: > Does somebody have a

Re: [go-nuts] Meet the Gogland dev team @ GopherCon

2017-07-07 Thread Sameer Ajmani
Awesome! Looking forward to meeting you all. On Fri, Jul 7, 2017 at 10:13 AM Florin Pățan wrote: > Hi all, > > > As this tweet mentions: > https://twitter.com/GoglandIDE/status/883294868260474880, the Gogland dev > team will be at GopherCon 2017 and they are looking

[go-nuts] Gophercon Diversity Forum Questionnaire

2017-07-07 Thread Sameer Ajmani
not use this form to report Code of Conduct issues. Instead, please follow the procedure described on https://golang.org/conduct Thank you, Sameer Ajmani Go team manager Google -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubs

Re: [go-nuts] Re: adding context.Context to new code

2017-05-14 Thread Sameer Ajmani
Specifically: don't pass nil Contexts. They are not valid, and most code that uses Contexts don't check for nil and will panic. On Sun, May 14, 2017 at 11:43 AM Sameer Ajmani <sam...@golang.org> wrote: > Generally I'd suggest passing context.Background() when calling functions &g

Re: [go-nuts] Re: adding context.Context to new code

2017-05-14 Thread Sameer Ajmani
;> as a whole, and from the consumer pov, >> i d say it is an impossible task in go because it it goes against its >> nature. >> And i confirm/understand that by reading to Sameer feedback. >> >> Notes: i m a strong lover of go type system (not talking about

Re: [go-nuts] Re: adding context.Context to new code

2017-05-12 Thread Sameer Ajmani
cheney talks about in > https://dave.cheney.net/2016/11/13/do-not-fear-first-class-functions > (search for Let’s talk about actors) > > Is the dzone link correctly describe > what you mentioned as being go context equivalent in java ? > > sorry my questions are so basic.

Re: [go-nuts] Re: adding context.Context to new code

2017-05-11 Thread Sameer Ajmani
bout chained func calls and not type system > handling, > and it might be easier to interleave the ctx.check in the flaw of ops, > I don t know enough to realize for sure. > > > > On Wednesday, May 10, 2017 at 11:40:27 PM UTC+2, Sameer Ajmani wrote: > >> Our

Re: [go-nuts] Re: adding context.Context to new code

2017-05-10 Thread Sameer Ajmani
easons? > > My tool is very poor, consider it as on going, a place for inspiration to > get started from absolutely no idea to lets get a dirty prototype. > not sure yet how long is going to be the road, still digging :) > > > On Tuesday, May 9, 2017 at 4:25:46 PM UTC+2, Sameer Ajma

Re: [go-nuts] Re: adding context.Context to new code

2017-05-09 Thread Sameer Ajmani
The eg tool can execute simple refactoring steps, but automating context plumbing through a chain of calls is an open problem. Alan Donovan put some thought into this a few years ago, and I've done a limited form of this using awk ;-) On Tue, May 9, 2017 at 6:10 AM wrote: > I

Re: [go-nuts] storing transaction in context

2017-02-08 Thread Sameer Ajmani
Historically we've insisted that the Context be passed explicitly so that it's always visible in the code and accessible to refactoring tools. In reality, tools that assist in context plumbing don't exist yet, and there are examples of putting Context inside some other structs in the standard

Re: [go-nuts] Go vet context leak error

2017-02-06 Thread Sameer Ajmani
Perhaps just read the deadline in the lock, then do the rest outside the lock: func (s *SimplePeerConn) Read(b []byte) (n int, err error) { s.deadlineLock.RLock() deadline := s.readDeadline s.deadlineLock.RUnlock() ctx := context.Background() if !deadline.IsZero() { dctx, cancel :=

Re: [go-nuts] GOMAXPROCS survey

2017-01-27 Thread Sameer Ajmani
Inside Google. we automatically update GOMAXPROCS when the job management system indicates that the container resources have changed. This usually happens when with either the user or automatic systems update the container resources based on observed use. I would expect other job management

Re: [go-nuts] Re: New Context method in http.Request, what can we do with it?

2016-07-14 Thread Sameer Ajmani
Unless you need to pass the Request, pass its Context. This eases the composition of functions across packages that all take Context parameters. On Thu, Jul 14, 2016 at 3:09 PM Tyler Compton wrote: > Thanks for the responses. I've used contexts before and understand that >