Re: [go-nuts] Channel Feature Suggestion

2019-02-21 Thread Serhat Sevki Dincer
Forgot to start it :P func main() { waiter() } 22 Şub 2019 Cum 09:56 tarihinde Kurtis Rader şunu yazdı: > I don't see where your `waiter()` function is used in your example. I have > been lurking till now but I concur with the other people who have told you > your proposal doesn't make any

Re: [go-nuts] Channel Feature Suggestion

2019-02-21 Thread Kurtis Rader
I don't see where your `waiter()` function is used in your example. I have been lurking till now but I concur with the other people who have told you your proposal doesn't make any situation easier to deal with and in fact is likely to be the source of bugs. On Thu, Feb 21, 2019 at 10:43 PM

Re: [go-nuts] Channel Feature Suggestion

2019-02-21 Thread Serhat Şevki Dinçer
Another use case is wait groups with Max number of goroutines allowed: ch:= make(chan bool, 10) func waiter() { ch <-true go worker() // when empty, all jobs are finished waitempty(ch) } func worker() { // do work Select { ch <- true: go worker() // try to handover some jobs

Re: [go-nuts] Is WASM support planned in go 1.12 ?

2019-02-21 Thread schmorrison
Ill be following your repo closely Max. Really like the looks of it! On Thursday, February 21, 2019 at 3:40:47 PM UTC-6, max...@segment.com wrote: > > I'm working on a wasm go library to build front end. > It is unstable on mobile but work fine on desktop (except Edge). > Waiting for go 1.12 to

Re: [go-nuts] Visual Studio Code oddity with Go

2019-02-21 Thread Brian Mcneely
On Thu, Feb 21, 2019, 9:42 PM andrey mirtchovski > I tried the solution posted by Andrey (Thank you!) and it still does the > popup thing. Oh well, it's a minor distraction, click update and it goes > away. > > If you go to the OUTPUT tab does it give you an error message? or does > it say

Re: [go-nuts] Visual Studio Code oddity with Go

2019-02-21 Thread Rich
Yeah. When I install the tool, it always gives me a success. When I selected all of them it also gave me a success. Thanks! On Thursday, February 21, 2019 at 10:42:33 PM UTC-5, andrey mirtchovski wrote: > > > I tried the solution posted by Andrey (Thank you!) and it still does the > popup

Re: [go-nuts] Channel Feature Suggestion

2019-02-21 Thread robert engels
By condition variable I mean sync.Cond > On Feb 21, 2019, at 3:10 PM, Robert Engels wrote: > > The proper solution is using a condition variable. You can handle the > proposed use case easily. There is no need for it to be specific to channels, > but you need another layer. > >> On Feb 21,

Re: [go-nuts] Visual Studio Code oddity with Go

2019-02-21 Thread robert engels
I use VS Code with Go on a Mac at times - usually IntelliJ - and don’t have that problem. Maybe uninstall, delete the preferences, and re-install. Just a thought. > On Feb 21, 2019, at 8:51 PM, Rich wrote: > > Just about every video on Go, I see people using VSC, and so was hoping to > find

Re: [go-nuts] Visual Studio Code oddity with Go

2019-02-21 Thread Dan Kortschak
Have you run `go get -u github.com/mdempsky/gocode` in a terminal? Is the binary put in your $PATH? If you try vim with vim-go or emac with go-mode does gocode work for you there? Dan On Thu, 2019-02-21 at 18:51 -0800, Rich wrote: > Just about every video on Go, I see people using VSC, and so

Re: [go-nuts] Visual Studio Code oddity with Go

2019-02-21 Thread Rich
Just about every video on Go, I see people using VSC, and so was hoping to find another Go user that has this problem, that's why I posted it here rather than the VSC Github site. I'm on a mac, reinstalled, deleted my settings -- all the usual stuff but it keeps popping up a message to install

[go-nuts] Re: sharing types between interface and implementation

2019-02-21 Thread DrGo
what worked for me in a largish project is using an internal package (named "types") to host types used in more than package. On Thursday, February 21, 2019 at 3:30:08 PM UTC-6, Manlio Perillo wrote: > > Hi. > > I'm implementing a generic (and very simple) interface for key-value > databases,

Re: [go-nuts] Visual Studio Code oddity with Go

2019-02-21 Thread andrey mirtchovski
reposting my private comment from a day ago for those searching for answers: try "command-shift-p" or ctrl-shift-p depending on your operating system, to bring the "all commands" pop-up. there you should be able to find "Go: Install/Update tools". click on the checkboxes. hit enter. On Wed, Feb

Re: [go-nuts] Re: Visual Studio Code oddity with Go

2019-02-21 Thread Dan Kortschak
Please remember to try to make golang-nuts a welcoming venue to discuss Go. The OP has tried to find out a solution and has been unable to. Asking here seems like a reasonable place. On Thu, 2019-02-21 at 17:28 -0800, Space A. wrote: > Nothing comes for free. For example, now you are wasting

[go-nuts] Re: Visual Studio Code oddity with Go

2019-02-21 Thread Space A.
Nothing comes for free. For example, now you are wasting your (and others) time. среда, 20 февраля 2019 г., 17:14:21 UTC+3 пользователь Rich написал: > > I tried googling this but I not been able to find a solution, hopefully I > can ask this here and someone else knows how to fix this. I

[go-nuts] The Seven Finest Go Books (to popularize and 'socialize' Go).

2019-02-21 Thread Akram Ahmad
- The amazing language that golang surely is, and how refreshingly (and elegantly) simple a language golang is—take this from someone coming from extensive experience in Java and Scala, two language which well-deservedly have a lot going for them—I think we need to do *more* to

Re: [go-nuts] Is WASM support planned in go 1.12 ?

2019-02-21 Thread maxence
I'm working on a wasm go library to build front end. It is unstable on mobile but work fine on desktop (except Edge). Waiting for go 1.12 to solves some issues. If you are on a desktop, you see the hello world example built with it here: wasm go hello world

[go-nuts] sharing types between interface and implementation

2019-02-21 Thread Manlio Perillo
Hi. I'm implementing a generic (and very simple) interface for key-value databases, and I'm using the standard database/sql package as a reference. The only difference is that I don't plan to have a Driver interface, but only a Database and Tx interfaces. For starting a transaction I'm

Re: [go-nuts] Channel Feature Suggestion

2019-02-21 Thread Robert Engels
The proper solution is using a condition variable. You can handle the proposed use case easily. There is no need for it to be specific to channels, but you need another layer. > On Feb 21, 2019, at 2:49 PM, Burak Serdar wrote: > >> On Thu, Feb 21, 2019 at 1:44 PM Serhat Şevki Dinçer >>

Re: [go-nuts] Channel Feature Suggestion

2019-02-21 Thread Burak Serdar
On Thu, Feb 21, 2019 at 1:44 PM Serhat Şevki Dinçer wrote: > > On Thursday, February 21, 2019 at 11:21:11 PM UTC+3, Jan Mercl wrote: >> >> But then calling it or not has the exact same semantics. So what's it even >> good for? > > > Let's take your case Jan: > > func consumer() { > select {

Re: [go-nuts] Channel Feature Suggestion

2019-02-21 Thread Michael Jones
Serhat, imagine your feature in the context of a buffered channel that holds 10 elements, and a writer go routine that wants to send 1000 elements through that channel. It is natural to imagine a downstream go routine reading and working on the first element, and the writer filling the empty slot

Re: [go-nuts] Channel Feature Suggestion

2019-02-21 Thread Serhat Şevki Dinçer
On Thursday, February 21, 2019 at 11:21:11 PM UTC+3, Jan Mercl wrote: > > But then calling it or not has the exact same semantics. So what's it even > good for? > Let's take your case Jan: func consumer() { select { case x := <-ch: // received, consume x default: //

Re: [go-nuts] Channel Feature Suggestion

2019-02-21 Thread Jan Mercl
But then calling it or not has the exact same semantics. So what's it even good for? On Thu, Feb 21, 2019, 21:17 Serhat Şevki Dinçer wrote: > btw waitempty(ch) does not return any value, and it does not (have to) > guarantee that ch stays empty when it returns.. > > > On Thursday, February 21,

Re: [go-nuts] Channel Feature Suggestion

2019-02-21 Thread Burak Serdar
On Thu, Feb 21, 2019 at 1:10 PM Serhat Şevki Dinçer wrote: > > Burak, I think you dont get the potential of the suggesred directives. > > You can be interested in waitepty(ch) for example when: > - you have direct control of who is pushing and pulling on it, and you know > what an empty buffer

Re: [go-nuts] Channel Feature Suggestion

2019-02-21 Thread Serhat Şevki Dinçer
btw waitempty(ch) does not return any value, and it does not (have to) guarantee that ch stays empty when it returns.. On Thursday, February 21, 2019 at 11:10:45 PM UTC+3, Serhat Şevki Dinçer wrote: > > Burak, I think you dont get the potential of the suggesred directives. > > You can be

Re: [go-nuts] Channel Feature Suggestion

2019-02-21 Thread Serhat Şevki Dinçer
Hi rog, As -> and <- are 'not racy', because they are 'core' language features, because runtime handles them, because they are guaranteed to 'work', I am asking how easy and useful to implement them as 'core' language features. Thank you.. On Thursday, February 21, 2019 at 9:04:22 PM UTC+3,

[go-nuts] drop-in replacement of net with default netgo build tag ?

2019-02-21 Thread Sebastien Binet
hi there, I am building a couple of packages that somehow need to import "net" and "net/http". I'd like for the users of my packages to get, by default, a statically linked binary. I know about the "go build -tags netgo" technique but I'd prefer if one didn't have to fiddle with those. so... is

[go-nuts] Re: Visual Studio Code oddity with Go

2019-02-21 Thread Louki Sumirniy
I believe that very notification has a button that triggers it to be automatically installed. Otherwise just exactly do what it says and it'll stop coming up and you'll get more juicy information from vscode about your go things. On Wednesday, 20 February 2019 15:14:21 UTC+1, Rich wrote: > > I

Re: [go-nuts] Channel Feature Suggestion

2019-02-21 Thread roger peppe
As others have said, such operations are inherently racy - when you receive the message that a channel is empty, it may not be empty any more. For that reason, it's not a good idea to add them as primitives to the language. That said, it's not too hard to implement them yourself. We are talking

Re: [go-nuts] Channel Feature Suggestion

2019-02-21 Thread Serhat Sevki Dincer
21 Şub 2019 Per 17:12 tarihinde Burak Serdar şunu yazdı: > On Thu, Feb 21, 2019 at 6:51 AM Serhat Sevki Dincer > wrote: > > > > But observer goroutines are not supposed to push to or pull from the > channel. > > What is a use case for observing a channel like this? If you call > waitempty(ch),

Re: [go-nuts] Channel Feature Suggestion

2019-02-21 Thread Michel Levieux
No but you can for example have a second channel from the pusher to the observer that signals (in case it cannot push anymore) the latter that the channel to which it tries to push to is full. The opposite is true from the consumer, that could signal via a second channel, when it cannot pull from

Re: [go-nuts] Channel Feature Suggestion

2019-02-21 Thread Serhat Sevki Dincer
meant has no guarantee 21 Şub 2019 Per 17:18 tarihinde Serhat Sevki Dincer şunu yazdı: > 21 Şub 2019 Per 17:12 tarihinde Burak Serdar şunu > yazdı: > >> On Thu, Feb 21, 2019 at 6:51 AM Serhat Sevki Dincer >> wrote: >> > >> > But observer goroutines are not supposed to push to or pull from the

Re: [go-nuts] Channel Feature Suggestion

2019-02-21 Thread Serhat Sevki Dincer
But observer goroutines are not supposed to push to or pull from the channel. 21 Şub 2019 Per 16:46 tarihinde Jan Mercl <0xj...@gmail.com> şunu yazdı: > On Thu, Feb 21, 2019 at 2:38 PM Serhat Şevki Dinçer > wrote: > > > waitempty(ch) > > blocks caller until ch buffer is empty > > Not exactly

Re: [go-nuts] Channel Feature Suggestion

2019-02-21 Thread Jan Mercl
On Thu, Feb 21, 2019 at 2:38 PM Serhat Şevki Dinçer wrote: > waitempty(ch) > blocks caller until ch buffer is empty Not exactly the same, but a similar mechanism exists: select { case x := <-ch: ... default: ... ch is empty } >

[go-nuts] Channel Feature Suggestion

2019-02-21 Thread Serhat Şevki Dinçer
Hi, Say you have a buffered channel ch := make(chan int, 10) Would it make sense and be easy to add the following directives to the Go language core? waitempty(ch) blocks caller until ch buffer is empty waitfull(ch) blocks caller until ch buffer is full This means there are 3 types of

Re: [go-nuts] Why does "go mod" ignore tags in this case?

2019-02-21 Thread roger peppe
I suspect it's because it's version 2. Major version v2 and above needs to have the version in the import path. So the correct import path for your package would be: github.com/twpayne/go-xdg/v2 It might be nice if the go tool complained about this at some stage of the process; I suspect