[go-nuts] Re: Is there a bug in path.Dir?

2016-06-19 Thread 徐新华
Package path implements utility routines for manipulating slash-separated(/) paths. So, you should use "path/filepath" -- 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 ema

Re: [go-nuts] Is there a bug in path.Dir?

2016-06-19 Thread Jan Mercl
On Mon, Jun 20, 2016 at 7:18 AM <18126523...@163.com> wrote: > Can it be considered as a bug in golang lib? The correct package to use is "path/filepath". -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group a

[go-nuts] Is there a bug in path.Dir?

2016-06-19 Thread 18126523585
In windows platform, path.Dir and path.Base can't get the correct result. The test code is like this: func main() { filename := "F:\\Test\\conf\\rkc1" i := strings.LastIndex(filename, string(filepath.Separator)) fmt.Println("dir1:", string(filename[:i+1])) fmt.Println

[go-nuts] Gomobile: Large .so/aar file size on Android

2016-06-19 Thread rajiivkanchan
Hi All Gomobile builds our 282 lines of Go code into a 5MB Android library(AAR). We were able to reduce this down to 2.6MB by including only the ARM targets (-target=android/arm,android/arm64) Since our APK budget for production builds is under 2MB, how can we reduce the AAR filesize further.

[go-nuts] Re: Discussion on "Vendoring edge case, critical problem"

2016-06-19 Thread Dave Cheney
If you mean forking their dependencies and rewiring their import paths, that is a possibility. But it leaves consumers of those packages in the same position as the thread the OP referenced because the same code is now known by two distinct import paths breaking type equality. -- You received

Re: [go-nuts] Using wss with Gorilla github.com/gorilla/websocket

2016-06-19 Thread Shawn Milochik
You will need a domain name for WSS/TLS. The difference between WS and WSS is as simple as using ListenAndServeTLS instead of ListenAndServe. You can even have an 'if' statement to serve either, so you can more easily test during development. https://golang.org/pkg/net/http/#ListenAndServeTLS -

[go-nuts] Using wss with Gorilla github.com/gorilla/websocket

2016-06-19 Thread Johann Höchtl
It was straightforward to get go with Gorilla Websocket. However how can I switch to a secure wss connection now? I am also currently serving from a plain IP without DNS, in order to go wss am I required to have a named address? Thank you! -- You received this message because you are subscrib

[go-nuts] Re: Discussion on "Vendoring edge case, critical problem"

2016-06-19 Thread Peter Kleiweg
Libraries can vendor in the directory "internal"? -- 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 golang-nuts+unsubscr...@googlegroups.com. For more options, vis

Re: [go-nuts] Re: Currying in Go

2016-06-19 Thread Jesper Louis Andersen
On Sat, Jun 18, 2016 at 5:32 AM, Tyler Compton wrote: > I don't pretend to be proficient in this realm of functional programming, > but I would be very surprised if this is valuable in a language like Go > that can and does hold state. In functional languages, it is often used as a way to "conf

[go-nuts] Re: Currying in Go

2016-06-19 Thread Christoph Berger
> this seems like an eyesore and maintenance concern. (...) it does cause me to hear code review sirens going off in the distance. Then why would you want to use currying in Go at all? What's the point of being able to write f(1)(2)(3) instead of f(1,2,3) *in a non-functional language?* Especi

[go-nuts] Unmarshalling and tags

2016-06-19 Thread 'Mihai B' via golang-nuts
Hi there, I have a struct that needs to be marshalled/unmarshalled using various serialization formats(xml, json, name/value). The tags start to represent a considerable effort[0] so I'm wondering if this is a common use case and if a change[1] to the encoding packages to specify the tag key/se

[go-nuts] Re: How to manage a web portal with multiple services without stopping and restarting everything at each release/fix?

2016-06-19 Thread Simon Ritchie
I think you will be hard put to match the performance of a PHP application on restart, and it may be faster in general. I've always assumed that this is due in part to the fact that the app is embedded in the web server and in part to the essential simplicity of the framework - PHP doesn't do a