Re: [go-nuts] go get creating strange git messages in bash. Any ideas what causes this ?

2016-09-16 Thread Wojciech S. Czarnecki
Dnia 2016-09-16, o godz. 07:48:32 Joe Blue napisał(a): > thanks again. > > your explanation about go get helped. > SO i looked at the offending repo. Its not my repo, just someones on github > > github.com/pkg/sftp Your *local* copy is in detached head state. I.e. you

Re: [go-nuts] Base58check to decimal

2016-09-16 Thread Donovan Hide
In the fact the author has already made it easy for you: https://github.com/saracen/bitcoin-all-key-generator Also, it starts at 1, not 0 :-) On 16 September 2016 at 11:30, Donovan Hide wrote: > Not sure what the exact questions is, but I think if you study and play >

Re: [go-nuts] go get creating strange git messages in bash. Any ideas what causes this ?

2016-09-16 Thread Joe Blue
thanks, it was a dependency of the repo. Makes sense. thanks. consider closed :) On Fri, Sep 16, 2016 at 11:27 AM Wojciech S. Czarnecki wrote: > Dnia 2016-09-16, o godz. 07:48:32 > Joe Blue napisał(a): > > > thanks again. > > > > your explanation about

[go-nuts] Parsing ambiguity?

2016-09-16 Thread Jan Mercl
Consider this program (https://play.golang.org/p/V0fu9rD8_D) package main import ( "fmt" ) func main() { c := make(chan int, 1) c <- 1 d := <-chan int(c) fmt.Printf("%T\n", d)

[go-nuts] filtering and forwarding email?

2016-09-16 Thread Tieson Molly
Are there any email projects in Go that can act as a email filter where the client would pull email down from the an account and based upon some rules forward the email. Best regards, Ty -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] go get creating strange git messages in bash. Any ideas what causes this ?

2016-09-16 Thread Joe Blue
thanks again. your explanation about go get helped. SO i looked at the offending repo. Its not my repo, just someones on github github.com/pkg/sftp What i cant work out is WHY this repo outputs weird git messages, and others dont. Its not blocking me working, but i am just wanting to know. I

[go-nuts] Re: make a struct pointer _not_ implement an interface

2016-09-16 Thread Jason E. Aten
On Monday, September 12, 2016 at 4:20:46 PM UTC-5, Alex Flint wrote: > > Is it possible to have a struct that implements an interface, but have > pointers to the struct not implement the interface? The reason is that I > want to find all the places in our codebase that attempt to use a pointer

Re: [go-nuts] Base58check to decimal

2016-09-16 Thread Donovan Hide
Not sure what the exact questions is, but I think if you study and play around with this section of code, you'll get somewhere closer to understanding how Bitcoin private keys and addresses work: https://github.com/saracen/directory.io/blob/master/directory.go#L70-L101 The (joke) app is

Re: [go-nuts] Re: Why + and += operators for string but not slices?

2016-09-16 Thread oyi812
The semantics of + and append() preclude a "data aliasing" ambiguity. Consider: c = a + b and c = append(a, b...) On Friday, September 16, 2016 at 9:14:45 PM UTC+1, Thomas Bushnell, BSG wrote: > > The values of the summation are indeed unambiguous, but the data aliasing > properties are

[go-nuts] Re: Why + and += operators for string but not slices?

2016-09-16 Thread oyi812
Thank you both. To Ian: but a slice is not a matrix or a list. To Axel: append() and copy() compliment indexing and slicing well enough. It would be a shame if ambiguity is indeed the reason. We've accepted 1 + 1 as numeric addition and "a" + "b" as string concatenation. For a slice,

Re: [go-nuts] Re: Why + and += operators for string but not slices?

2016-09-16 Thread 'Thomas Bushnell, BSG' via golang-nuts
The values of the summation are indeed unambiguous, but the data aliasing properties are not. On Fri, Sep 16, 2016, 12:58 PM wrote: > Thank you both. > > To Ian: but a slice is not a matrix or a list. > > To Axel: append() and copy() compliment indexing and slicing well

[go-nuts] How example can be run in test?

2016-09-16 Thread James Bardin
This is fixed in master. In go1.7 the Examples and Benchmarks aren't run if there are no Test functions. -- 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

[go-nuts] differences between pointer and value slice in for-range loop

2016-09-16 Thread Fei Ding
Hi: Please check this code snippet: package main import ( "fmt" "time" ) type field struct { name string } func (p *field) print() { fmt.Println(p.name) } func main() { fmt.Println("use values:") // use values in range loop and go rountines values :=

Re: [go-nuts] Re: Why + and += operators for string but not slices?

2016-09-16 Thread Jesse McNelis
On 17 Sep 2016 12:31 p.m., wrote: > > Context enables homonyms in spoken languages and overloaded or polymorphic notation in mathematics. Types do the same in programming languages. The rationale for + over join() or cat() for string is equally applicable to slices. 1+1 give

Re: [go-nuts] Re: Why + and += operators for string but not slices?

2016-09-16 Thread 'Thomas Bushnell, BSG' via golang-nuts
The thread already shows several alternative interpretations which are different from that. Go tries to avoid constructions that require careful specification of that sort. Append already causes enough confusion, but that's important enough that dropping it would be a loss. + for slices is only

[go-nuts] Re: Why + and += operators for string but not slices?

2016-09-16 Thread paraiso . marc
Because Go creators have a strong opinion about what + means. I would argue the languages that engage into these sort of things especially those who allow operator overloading are antithetic to Go goals, but that's an opinion., I didn't create Go, I don't agree with all its design choices but

[go-nuts] Re: Why + and += operators for string but not slices?

2016-09-16 Thread oyi812
Context enables homonyms in spoken languages and overloaded or polymorphic notation in mathematics. Types do the same in programming languages. The rationale for + over join() or cat() for string is equally applicable to slices. a ++ b wouldn't be an unreasonable replacement for append(a, b...)

Re: [go-nuts] How to deal with "Expect: 100-continue" *without* sending a 100 status

2016-09-16 Thread David Anderson
Tricky one. A couple of options spring to mind, none of them amazingly good: - Use a GCE Network LB instead of HTTP LB. You can bring the TCP sessions straight to your web servers, with load-balancing done per-TCP-session rather than per-HTTP-request. - Build your web server using a

Re: [go-nuts] Parsing ambiguity?

2016-09-16 Thread Jan Mercl
On Fri, Sep 16, 2016 at 4:02 PM Ian Lance Taylor wrote: > The rule you are looking for is at https://golang.org/ref/spec#Conversions : "If the type starts with the operator * or <-, or if the type starts with the keyword func and has no result list, it must be parenthesized when

Re: [go-nuts] Regex questions: flags & match from start of string

2016-09-16 Thread Ian Lance Taylor
On Fri, Sep 16, 2016 at 7:00 AM, Scott Frazer wrote: > I'm struggling a lot here... I want to be able to pass flags to my regexps > (specifically the flag where dot matches any character). The only mention > of flags at all is here:

Re: [go-nuts] Parsing ambiguity?

2016-09-16 Thread Ian Lance Taylor
On Fri, Sep 16, 2016 at 3:42 AM, Jan Mercl <0xj...@gmail.com> wrote: > Consider this program (https://play.golang.org/p/V0fu9rD8_D) > > package main > > import ( > "fmt" > ) > > func main() { > c := make(chan int, 1) >

[go-nuts] Regex questions: flags & match from start of string

2016-09-16 Thread Scott Frazer
I'm struggling a lot here... I want to be able to pass flags to my regexps (specifically the flag where dot matches any character). The only mention of flags at all is here: https://golang.org/pkg/regexp/syntax/#Parse. Though this API is strange and confusing. I'm not sure what exactly to do

[go-nuts] Re: Parsing ambiguity?

2016-09-16 Thread adonovan via golang-nuts
On Friday, 16 September 2016 06:43:38 UTC-4, Jan Mercl wrote: > > Which rule selects the first parse? Can anybody please enlighten me? > Thanks in advance. > The grammar is indeed ambiguous, but the ambiguity is (implicitly) resolved by favoring the leftmost derivation, which is what you get

Re: [go-nuts] filtering and forwarding email?

2016-09-16 Thread Shawn Milochik
Sure, all you need is the ability to send and receive e-mail. Then you write your filtering logic. https://github.com/go-gomail/gomail This will take care of the heavy lifting. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

Re: [go-nuts] filtering and forwarding email?

2016-09-16 Thread Tieson Molly
could you recommend a good POP3 library? Best regards, Ty On Friday, September 16, 2016 at 10:16:39 AM UTC-4, Shawn Milochik wrote: > > Sure, all you need is the ability to send and receive e-mail. Then you > write your filtering logic. > > https://github.com/go-gomail/gomail > > This will

Re: [go-nuts] Re: Is it possible to serve a directory without indexing the contents?

2016-09-16 Thread Rodrigo Kochenburger
Oh, my bad. I've updated the example to properly reference the embedded fs' Open. https://play.golang.org/p/wbfrElxCsH On Thu, Sep 15, 2016 at 8:09 PM tobyjaguar wrote: > Rodrigo, I may need a bit more help with your example. > Can you get me past the Open function, when

Re: [go-nuts] Re: Parsing ambiguity?

2016-09-16 Thread Jan Mercl
On Fri, Sep 16, 2016 at 4:13 PM adonovan via golang-nuts < golang-nuts@googlegroups.com> wrote: > The grammar is indeed ambiguous, but the ambiguity is (implicitly) resolved by favoring the leftmost derivation, which is what you get from an LL(k) parser. By the same token (hah!), the grammar

[go-nuts] Need explain on error inteface work?

2016-09-16 Thread Giang Tran
Hello I have a small test like this package main type MError struct { } func (m *MError) Error() string { return "MError" } func NewMError() *MError { return nil } func main() { var e error e = NewMError() println(e.Error()) } I know that interface actually combine like (Type,

[go-nuts] [ANN] go-scp: a scp client library in go

2016-09-16 Thread Hiroaki Nakamura
Hi all, I noticed the golang.org/x/crypto/ssh package exists, but the scp package does not. So I wrote a scp client library in go. https://github.com/hnakamur/go-scp I also wrote a sshd server just usable for testing go-scp. https://github.com/hnakamur/go-sshd Right now, go-scp only exports

[go-nuts] Re: Is it possible to serve a directory without indexing the contents?

2016-09-16 Thread tobyjaguar
Thanks Rodrigo. When you suggested rewriting the FileSystem I re-implemented src/net/http/fs.go and it seems the offender is in the serveFile function: if d.IsDir() { if checkLastModified(w, r, d.ModTime()) { return } //dirList(w, f) <-here return } This seems to be working. I will try your

Re: [go-nuts] Need explain on error inteface work?

2016-09-16 Thread Ian Lance Taylor
On Fri, Sep 16, 2016 at 8:24 AM, Giang Tran wrote: > > I have a small test like this > > package main > > type MError struct { > > } > > func (m *MError) Error() string { > return "MError" > } > > func NewMError() *MError { > return nil > } > > func main() { > var e error >

Re: [go-nuts] Why + and += operators for string but not slices?

2016-09-16 Thread Ian Lance Taylor
On Fri, Sep 16, 2016 at 9:02 AM, wrote: > I have not been able to find an explanation. Does anyone care to explain or > point to relevant documentation? Slices are not strings. I think that a + b has an intuitively clear value when a and b are strings. I do not think it does

[go-nuts] How to deal with "Expect: 100-continue" *without* sending a 100 status

2016-09-16 Thread Ian Rose
Howdy, I'm currently running a group of Go web servers behind an HTTP(s) load balancer on Google Compute Engine. Unfortunately I have learned that GCE load balancers do not support the "Expect: 100-continue" header [1]. From my experiments, it appears that it isn't actually the request

[go-nuts] Re: How example can be run in test?

2016-09-16 Thread nickle
you are using the testing framework incorrectly- https://golang.org/pkg/testing/ your function is incompatible with the test harness. The function signature must follow a few rules. Your test file does not have any functions matching the required signature. What you are doing is running an

[go-nuts] Why + and += operators for string but not slices?

2016-09-16 Thread oyi812
I have not been able to find an explanation. Does anyone care to explain or point to relevant documentation? -- 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

Re: [go-nuts] Why + and += operators for string but not slices?

2016-09-16 Thread 'Axel Wagner' via golang-nuts
I would take it to mean c := make(elementof(a), len(a)+len(b)) copy(c, a) copy(c[len(a):], b) which is subtly different from append(a, b...). And when you don't care about the difference, it would be less efficient. For strings, on the other hand, it can only mean one of the two (as strings are

Re: [go-nuts] Need explain on error inteface work?

2016-09-16 Thread Giang Tran
got it, thank you. On Saturday, September 17, 2016 at 12:14:34 AM UTC+7, Ian Lance Taylor wrote: > > On Fri, Sep 16, 2016 at 8:24 AM, Giang Tran > wrote: > > > > I have a small test like this > > > > package main > > > > type MError struct { > > > > } > > > > func