[go-nuts] looking for example of CloseRead in production code

2017-02-03 Thread Skip Tavakkolian
Does anyone have a pointer to production code that uses CloseRead or CloseWrite (TCPConn or UnixConn)? I am aware of the net/http test cases. Thanks, -Skip -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

Re: [go-nuts] 9fans.net/go

2017-02-19 Thread Skip Tavakkolian
if want to run those utilities in Plan 9 you don't need to worry about speaking 9P with the underlying services -- i.e. no need for plan9/client package. the file hierarchies for plumber, acme, draw, etc. are mounted into the process' namespace. for example, acme's namespace is mounted on

Re: [go-nuts] 9fans.net/go

2017-02-19 Thread Skip Tavakkolian
> except for the same problem of *os.File not implementing > io.ByteReader, and the fact that now the same function on different > platforms has different signatures, because the default plumb.Open is > defined as returning a concrete type from plan9/client, not an > interface..) > >

Re: [go-nuts] First tutorials for iranian users

2016-08-28 Thread Skip Tavakkolian
Hi Erfan, This is cool! I skimmed through the videos. I think the videos are great for students learning Go as their first language. I read the intro page, and I think your reasons for "a bright future for Go" are reasonable but somewhat subjective. I think it would be useful to include why Go

[go-nuts] pet peeve: it's Go not golang

2017-07-25 Thread Skip Tavakkolian
Although "go" is a verb, an adjective and a noun (including the game), there shouldn't be any confusion in what Go is, when posting to a list dedicated to the language. Thanks, -Skip -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] Re: pet peeve: it's Go not golang

2017-07-25 Thread Skip Tavakkolian
I was specifically referring to things posted to this list to avoid the old chestnut about search. For what it's worth, I don't buy that argument either. Searching for "game of life in go language" works just as well. Correctness matters even when nobody is looking. On Tue, Jul 25, 2017, 2:47 PM

Re: [go-nuts] Re: pet peeve: it's Go not golang

2017-07-30 Thread Skip Tavakkolian
Erlang is assumed to be a node to the Danish mathematician Erlang, an important figure in telephony queuing theory. On Sun, Jul 30, 2017, 9:10 PM simran wrote: > Er? > > sorry, couldn't help myself :) > > Go Go! > > > > On Mon, Jul 31, 2017 12:24 PM, Dave Cheney d...@cheney.net

Re: [go-nuts] Re: Nil Channels and Case Evaluation

2018-08-08 Thread Skip Tavakkolian
i think the compiler has identified both problems correctly; c is nil (no cases) and nothing is receiving from c (deadlock). package main func main() { // var c chan struct{} c := make(chan struct{}) go func(x chan struct{}) { <-x }(c) select { case c <- f(): } } func f() struct{} { println("f

Re: [go-nuts] Cross-compiled program for Raspberry Pi crashes

2018-08-12 Thread Skip Tavakkolian
Rpi1 model B requires setting GOARM=5 I believe. On Sun, Aug 12, 2018, 8:29 AM Stephan Mühlstrasser < stephan.muehlstras...@gmail.com> wrote: > Hi, > > I'm developing my first Go program that is supposed to upload files into a > Google Cloud Storage bucket from a Raspberry Pi 1. It uses the >

Re: [go-nuts] websocket implentation in golang

2018-10-24 Thread Skip Tavakkolian
Here's a sketch: https://gist.github.com/9nut/11052587 On Wed, Oct 24, 2018 at 4:20 AM sakthi apr wrote: > Hi, > > I'm developing web socket in golang that checks the database changes like > new data insert. > > if the new record added in table user will get notified at client side. > >

Re: [go-nuts] Channels: selecting the last element

2018-12-18 Thread Skip Tavakkolian
why not just drop the select? i think the following is guaranteed because putting things on rc has to succeed before putting true into dc: package main import ( "fmt" ) func do(i int, rc chan<- int, dc chan<- bool) { rc <- i dc <- true } func main() { worker := 10 rc := make(chan int, worker)

Re: [go-nuts] invalid recursive type alias

2018-12-08 Thread Skip Tavakkolian
I think in the second case it is a reasonable error because the type alias has not been defined yet while the anonymous struct is being declared. On Sat, Dec 8, 2018, 9:33 AM Jan Mercl <0xj...@gmail.com wrote: > This code compiles fine > > package main > > type node struct { >

Re: [go-nuts] Producer-Consumer with Goroutines

2019-01-25 Thread Skip Tavakkolian
if the intent is to "print" the producer's output before the consumer's, then this example still can't guarantee it; for example: https://play.golang.org/p/2sb67Qf5IPd the only synchronization guarantee is the moment of exchange on the channel. On Fri, Jan 25, 2019 at 3:27 AM Wagner Riffel

Re: [go-nuts] Concurrency safe struct access

2019-04-14 Thread Skip Tavakkolian
I believe you only need one or the other; I assumed a use case like this: https://play.golang.org/p/nSgyiXU87XN On Sun, Apr 14, 2019 at 1:33 PM wrote: > I found a good discussion in the FAQ that explains the problem clearly. > https://golang.org/doc/faq#methods_on_values_or_pointers > > I

Re: [go-nuts] Remind me, please, about "taking over" a socket

2019-05-30 Thread Skip Tavakkolian
Do you mean like tcp half-close? On Thu, May 30, 2019, 5:40 PM David Collier-Brown wrote: > My leaky brain has lost an old technique... > > Once upon a time, I would send an old copy of a program a SIGHUP, and it > would shut down a socket listening on, for example, port 25 (SMTP). A newer >

Re: [go-nuts] Let's play

2019-07-13 Thread Skip Tavakkolian
If your security depends on you not clicking on hyperlinks, you don't have security. On Fri, Jul 12, 2019, 10:39 AM Marvin Renich wrote: > * Ali Hassan [190712 12:56]: > > > > If you curious about check out the link below > > >

Re: [go-nuts] is -2147483648 the same as MinInt32

2019-04-21 Thread Skip Tavakkolian
Use Ivy? On Sun, Apr 21, 2019, 8:36 PM Pat Farrell wrote: > I have a logic error in my calculation. I am getting -2147483648 in an > int32 > This sure looks a lot like MinInt32, but I can't seem to be able to tell, > all my calculators want to blow up on -1 << 31 > > > I'm willing to bet

Re: [go-nuts] Concurrency safe struct access

2019-04-14 Thread Skip Tavakkolian
I don't know if it's documented or not. In the language reference you can see the rules for method calls: https://golang.org/ref/spec#Calls https://golang.org/ref/spec#Method_sets A hint might have been that object should have mutated, but it didn't. It's in a class of errors that becomes

Re: [go-nuts] How to open browser with NTLM auth

2019-10-29 Thread Skip Tavakkolian
the code is working, but the user/pass are incorrect. user param may need the domain name (i.e. "DOMAIN\\username") curl uses the stored credentials, which are usually created when user signs in or unlocks a session. On Mon, Oct 28, 2019 at 7:20 PM wrote: > When I use go-ntlmssp I get error

Re: [go-nuts] How to open browser with NTLM auth

2019-10-23 Thread Skip Tavakkolian
Googling for "NTLM http go client", the first result looks legit: https://github.com/Azure/go-ntlmssp On Tue, Oct 22, 2019 at 10:20 PM wrote: > I'm trying emulate browser, open intranet url and get status code 401. How > to open url with NTLM auth or login, pass? Thanks > > package main >

Re: [go-nuts] Interesting "select" examples

2023-04-03 Thread Skip Tavakkolian
Nice pause/resume. I'll need to remember this. On Mon, Apr 3, 2023 at 3:14 AM Rob Pike wrote: > > Here's an excerpt from a piece of concurrent code I like, an unpublished > interactive game of life. The select near the bottom has only two cases but > it is perhaps instructive. I leave its

Re: [go-nuts] Interesting "select" examples

2023-04-03 Thread Skip Tavakkolian
I think this qualifies: mux9p, Fazlul Shahriar's port of Russ' 9pserve (plan9port) https://github.com/fhs/mux9p/search?q=clientIO I've used this dispatcher pattern: func dispatcher(commands chan Cmd, reporting chan Stats, worker Worker) { control = make(chan ...) counts = make(chan ...)

Re: [go-nuts] Interesting "select" examples

2023-04-03 Thread Skip Tavakkolian
On Mon, Apr 3, 2023 at 5:22 PM Nigel Tao wrote: > > On Tue, Apr 4, 2023 at 7:56 AM Skip Tavakkolian > wrote: > > mux9p, Fazlul Shahriar's port of Russ' 9pserve (plan9port) > > https://github.com/fhs/mux9p/search?q=clientIO > > > > ... > > > >