[go-nuts] Re: Implicit cast of string vs. []byte

2017-06-24 Thread Stefan Nilsson
This may not be what you want, but starting from Go 1.9 it's possible to declare a type alias using the syntax type MyString = string As opposed to a type definition, an alias declaration doesn't create a new distinct type different from the type it's created from. Type aliases are not meant t

Re: [go-nuts] Disable directory listing with http.FileServer

2017-06-24 Thread koti
It won't serve index.html file by default like in case of neuteredReaddirFile On Wednesday, March 16, 2016 at 10:38:22 AM UTC+5:30, George Armhold wrote: > > I've settled on the following, which has the added benefit of returning 404 > for directories. > > > Corrections appreciated. > > > > type

[go-nuts] Help how to write golang test when one function call other function internally which is independent

2017-06-24 Thread pratik dhanave
Hi arschles, I am go-lang beginner programmer I am working on google compute engine API where createinstnace() method internally call authentication sign() function which print URL to visit and accept authentication code and generate and return oauth token which I used in createinst

Re: [go-nuts] Implicit cast of string vs. []byte

2017-06-24 Thread Ivan Bertona
I see, thank you! On Saturday, June 24, 2017 at 5:46:55 PM UTC-7, Ayan George wrote: > > > On 06/24/2017 08:16 PM, Ivan Bertona wrote: > > Hello, > > > > When I try to compile this piece of code: > > > > I think it violates the second assignability rule since both 'string' > and MyString are

Re: [go-nuts] Implicit cast of string vs. []byte

2017-06-24 Thread Ayan George
On 06/24/2017 08:16 PM, Ivan Bertona wrote: > Hello, > > When I try to compile this piece of code: > I think it violates the second assignability rule since both 'string' and MyString are named types. string happens to be a a pre-declared named type: https://golang.org/ref/spec#Assignability

[go-nuts] Implicit cast of string vs. []byte

2017-06-24 Thread Ivan Bertona
Hello, When I try to compile this piece of code: package main type MyString string type MyBytes []byte func GetString() (string, error) { return "", nil } func GetBytes() ([]byte, error) { return nil, nil } func main() { var s MyString var b MyBytes var err error s, err = GetString() b, err

[go-nuts] How to manage multiple versions of Go?

2017-06-24 Thread st ov
Do you use gvm? https://github.com/moovweb/gvm Is there a simpler way? How do you avoid conflicts with Homebrew? Should I not run 'brew install go'? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiv

Re: [go-nuts] Base64

2017-06-24 Thread Steven Hartland
Might want to ask on a java mailing list not a golang one ;-) On 24/06/2017 13:09, Manish Asolkar wrote: hi, I have two Window machines one has *Server 2008 R2* and another on has *Server 2012 R2* with same *JDK version 1.8.* I am working on a financial application where I receive a base64

[go-nuts] Attemping a native Go android app, running into gobind error

2017-06-24 Thread dan
I am working on creating an android app entirely in go using the Java og bindings, as outlined in https://github.com/golang/mobile/tree/master/example/reverse I created a go project under my goroot and an android project in my ~/AndroidStuioProjects I seem to have the configs right but I seem to

[go-nuts] Base64

2017-06-24 Thread Manish Asolkar
hi, I have two Window machines one has *Server 2008 R2* and another on has *Server 2012 R2* with same *JDK version 1.8.* I am working on a financial application where I receive a base64 encoded public encrypted value which I need to decode using Base64, decrypt and validate. My program is

Re: [go-nuts] Re: RFC: Blog post: How to not use an HTTP router

2017-06-24 Thread 'Axel Wagner' via golang-nuts
On Sat, Jun 24, 2017 at 11:43 AM, wrote: > The goal of a (proper) router is to decouple routes from handlers, thus > making refactoring easier by adopting a declarative form rather than an > imperative one. > Yes. And it is my opinion that this is a bad thing. > It's the good old builder patte

[go-nuts] Re: RFC: Blog post: How to not use an HTTP router

2017-06-24 Thread prades . marq
The goal of a (proper) router is to decouple routes from handlers, thus making refactoring easier by adopting a declarative form rather than an imperative one. It's the good old builder pattern. By deeming it unnecessary you did nothing but couple your handlers with your routes. That's the only

Re: [go-nuts] Re: RFC: Blog post: How to not use an HTTP router

2017-06-24 Thread 'Axel Wagner' via golang-nuts
Yeah, I do. And that's what I get for not testing my code, this is the second mistake someone found :) Thanks for noticing it, I'll push a fix in a minute. On Sat, Jun 24, 2017 at 2:54 AM, Steve Roth wrote: > Hello, Axel, > > I like your concept and I am applying it. But I believe that the code