Re: [go-nuts] plugin questions....

2017-02-28 Thread Basile Starynkevitch
On Wednesday, March 1, 2017 at 7:17:42 AM UTC+1, Ian Lance Taylor wrote: > > On Tue, Feb 28, 2017 at 12:44 PM, Basile Starynkevitch > wrote: > > Can the packages defined in one plugin be visible from plugins loaded > > afterwards? I'm thinking of a dlopen with

Re: [go-nuts] plugin questions....

2017-02-28 Thread Ian Lance Taylor
On Tue, Feb 28, 2017 at 12:44 PM, Basile Starynkevitch wrote: > > Can a plugin be made of several source files in Go? Yes. > How should then I > compile a single plugin myfoo.so from several Go source files ? Can a > plugin define several packages? A plugin is a main

[go-nuts] Pipm your brain. Golang exercise

2017-02-28 Thread tanya - cube
Anagram exercise -- 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

Re: [go-nuts] plugin questions....

2017-02-28 Thread Basile Starynkevitch
On Tuesday, February 28, 2017 at 10:16:27 PM UTC+1, Ian Lance Taylor wrote: > > On Tue, Feb 28, 2017 at 12:44 PM, Basile Starynkevitch > wrote: > > > > A few questions and wishes about plugins (Go1.8 Linux/amd64) > > Sorry, but you need to indicate whether you are

[go-nuts] Re: Golang and WebAssembly

2017-02-28 Thread Dmitry Pavluk
FYI there's now a GItHub issue tracking the developent of wasm support. On Tuesday, July 7, 2015 at 9:08:22 PM UTC-4, Ilya Kowalewski wrote: > > Salute nuts, > > I read about WebAssembly (WA) recently and this topic haven't left my head > ever since.

[go-nuts] Re: Some best practices for debuging and optimizing with -gcflags?

2017-02-28 Thread Derek Parker
FWIW Delve (https://github.com/derekparker/delve) sets the proper `gcflags` to produce a binary optimal for debugging if you need a debugger. On Monday, February 27, 2017 at 4:17:39 PM UTC-8, jamalsm...@gmail.com wrote: > > What are some best practices for general purpose -gcflags to use for >

Re: [go-nuts] Support for the race detector on ARM

2017-02-28 Thread Owen Waller
Hi Dimitry, > > > The make goal of the current mapping is to make MemToShadow function > fast (no memory accesses, no branching). > For starters you can take any simple mapping at the cost making > MemToShadow slower. > OK that's good. As I wasn't intending to do anything apart from put in the

[go-nuts] x509.Certificate Template: Is there any support for URI in SubjectAltName?

2017-02-28 Thread lita via golang-nuts
Link: https://godoc.corp.google.com/pkg/crypto/x509/#Certificate Seems currently it only supports as listed below, is there plan to support URI? // Subject Alternate Name valuesDNSNames []string EmailAddresses []string IPAddresses[]net

[go-nuts] Subject_Alt_name in x509.Certificate

2017-02-28 Thread 'Tao Li' via golang-nuts
Currently it only supports DNSNames, EmailAddresses, and IPAddresses, is there any plan to support URI as well? Thanks Tao -- 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

Re: [go-nuts] Extra bytes in Gob format

2017-02-28 Thread Rob Pike
When writing singletons (Encode() as opposed to Encode()), the code essentially wraps it in a struct and makes it a single field, because the rest of the code works that way. I don't remember the exact reason it was built like that, other than the fact that singletons came later, but it doesn't

Re: [go-nuts] Extra bytes in Gob format

2017-02-28 Thread 'Axel Wagner' via golang-nuts
I'm not convinced of that, as I'm having trouble seeing the logic behind those extra bytes (they don't seem necessary or to convey any information to me), but I decided to wait for whatever update is deemed appropriate and then reevaluate :) On Tue, Feb 28, 2017 at 4:44 PM, Sam Whited

Re: [go-nuts] Extra bytes in Gob format

2017-02-28 Thread Sam Whited
On Tue, Feb 28, 2017 at 11:49 AM, Axel Wagner wrote: > FYI, this looks very similar to this issue I filed a while back: > https://github.com/golang/go/issues/16978 Looks like there's nothing to do here (except the actual work to update the docs); thanks Axel! —Sam

Re: [go-nuts] plugin questions....

2017-02-28 Thread Ian Lance Taylor
On Tue, Feb 28, 2017 at 12:44 PM, Basile Starynkevitch wrote: > > A few questions and wishes about plugins (Go1.8 Linux/amd64) Sorry, but you need to indicate whether you are talking about -buildmode=plugin (an experimental option to build plugins that may be opened by

[go-nuts] plugin questions....

2017-02-28 Thread Basile Starynkevitch
Hello All, A few questions and wishes about plugins (Go1.8 Linux/amd64) Can a plugin be made of several source files in Go? How should then I compile a single plugin myfoo.so from several Go source files ? Can a plugin define several packages? Can a plugin contain several packages? How can

Re: [go-nuts] Linking static c++ library with Go using SWIG

2017-02-28 Thread Chun Zhang
Thank you for your reply! I read a few posts between you and Stephen before posting this. Sorry, it was a bad copy and paste. I did have the import "C" line in the file. But I have the same error. I can "go build libcolor.go" itself with no error. But that does not seem to build the whole

[go-nuts] Go 1.8 compiler SEGV - issue #19323

2017-02-28 Thread Basile Starynkevitch
Hello All, I'm still a newbie, and I managed to crash the Go 1.8 compiler (Linux/amd64/Debian/Sid). Probably I have some mistake in my own code (but I am not expecting it to SEGV the compiler) I've written my first Go report. https://github.com/golang/go/issues/19323 Is it complete enough?

Re: [go-nuts] Linking static c++ library with Go using SWIG

2017-02-28 Thread Ian Lance Taylor
On Tue, Feb 28, 2017 at 11:04 AM, Chun Zhang wrote: > > An empty libcolor.go file with the following lines was manually created > > --- > package libcolor > > // #cgo CFLAGS: -I . > // #cgo CXXFLAGS: -std=c++11 <--- this does not seem to work > // #cgo

[go-nuts] Linking static c++ library with Go using SWIG

2017-02-28 Thread Chun Zhang
Hi, All, I have googled quite a bit about this issue, there are some tutorials online. But most of them targeted either at older go releases or C instead of C++. Can somebody please help me to figure out how to solve the following issues? I have to use a static library, wrote in C++ in a go

[go-nuts] Re: casting slice of rune to string picks up extra characters for some inputs

2017-02-28 Thread Robert Johnstone
Hello, Strings are encoded using UTF-8, which is a multi-byte encoding. Different runes require different lengths to be encoded, and the prefix you noted is how that length is transmitted (although the ranges in your message don't seem to be correct). Robert On Tuesday, 28 February 2017

[go-nuts] Re: Building golang on MIPS using gccgo

2017-02-28 Thread Ian Lance Taylor
On Tue, Feb 28, 2017 at 9:41 AM, James Cowgill wrote: > > On 28/02/17 17:30, Ian Lance Taylor wrote: >> On Tue, Feb 28, 2017 at 7:33 AM, James Cowgill >> wrote: >>> >>> Stumbling over this thread: >>>

Re: [go-nuts] casting slice of rune to string picks up extra characters for some inputs

2017-02-28 Thread Ian Lance Taylor
On Tue, Feb 28, 2017 at 9:05 AM, Fraser Hanson wrote: > https://play.golang.org/p/05wZM9BhfB > > I'm working on some code that reads UTF32 and converts it to go strings. > I'm finding some surprising behavior when casting slices of runes to > strings. > > runes :=

Re: [go-nuts] Extra bytes in Gob format

2017-02-28 Thread 'Axel Wagner' via golang-nuts
FYI, this looks very similar to this issue I filed a while back: https://github.com/golang/go/issues/16978 On Tue, Feb 28, 2017 at 12:07 PM, Rob Pike wrote: > Please do. > > I was sure it was there somewhere but I couldn't find it. Check again > (look internally as well) before

[go-nuts] Re: casting slice of rune to string picks up extra characters for some inputs

2017-02-28 Thread Fraser Hanson
I understand now, it's just the UTF-8 representation of these runes. Even though ascii 128-255 are representable as single bytes (e.g. 0x80), UTF-8 doesn't do it that way and prepends a byte. The results seen in my output are shown as the UTF-8 representation in the unicode tables:

Re: [go-nuts] casting slice of rune to string picks up extra characters for some inputs

2017-02-28 Thread Rob Pike
https://en.wikipedia.org/wiki/UTF-8 https://blog.golang.org/strings -rob -- 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] Re: casting slice of rune to string picks up extra characters for some inputs

2017-02-28 Thread Volker Dobler
Strings in Go are UTF-8, so it's expected. See e.g. http://www.fileformat.info/info/unicode/char/00a9/index.htm What bytes for © _would_ you expect? And why? V. Am Dienstag, 28. Februar 2017 18:29:07 UTC+1 schrieb Fraser Hanson: > > https://play.golang.org/p/05wZM9BhfB > > I'm working on some

[go-nuts] Can ServerMux serve two different handler functions on / and a path beyond / ?

2017-02-28 Thread Howard Guo
Hey fellow gophers. As it is currently implemented, if http.ServerMux serves a FileServer on a path beyond "/", for example "/mydir", and then serves a very different document on "/", the FileServer handler will not be triggered at all and the "/" handler gets all the requests. Is there a

[go-nuts] Re: Building golang on MIPS using gccgo

2017-02-28 Thread James Cowgill
Hi, On 28/02/17 17:30, Ian Lance Taylor wrote: > On Tue, Feb 28, 2017 at 7:33 AM, James Cowgill > wrote: >> >> Stumbling over this thread: >> https://groups.google.com/forum/#!topic/golang-nuts/waTy56I_KWQ >> >> On 25/03/16 17:08, Ian Lance Taylor wrote: >>> mipsn64 is

[go-nuts] Re: Building golang on MIPS using gccgo

2017-02-28 Thread Ian Lance Taylor
On Tue, Feb 28, 2017 at 7:33 AM, James Cowgill wrote: > > Stumbling over this thread: > https://groups.google.com/forum/#!topic/golang-nuts/waTy56I_KWQ > > On 25/03/16 17:08, Ian Lance Taylor wrote: >> mipsn64 is a GOARCH value used by gccgo, but not by gc. The gc >>

[go-nuts] casting slice of rune to string picks up extra characters for some inputs

2017-02-28 Thread Fraser Hanson
https://play.golang.org/p/05wZM9BhfB I'm working on some code that reads UTF32 and converts it to go strings. I'm finding some surprising behavior when casting slices of runes to strings. runes := []rune{'©'} fmt.Printf(" cast to string: (%s)\n", string(runes)) fmt.Printf("bytes in string:

[go-nuts] Building golang on MIPS using gccgo

2017-02-28 Thread James Cowgill
Hi, Stumbling over this thread: https://groups.google.com/forum/#!topic/golang-nuts/waTy56I_KWQ On 25/03/16 17:08, Ian Lance Taylor wrote: > mipsn64 is a GOARCH value used by gccgo, but not by gc. The gc > compiler uses mips64 and mips64le. It's not clear to me how we are > going to resolve

Re: [go-nuts] Extra bytes in Gob format

2017-02-28 Thread Rob Pike
Please do. I was sure it was there somewhere but I couldn't find it. Check again (look internally as well) before proceeding. -rob On Tue, Feb 28, 2017 at 8:53 AM, Sam Whited wrote: > On Tue, Feb 28, 2017 at 1:04 AM, Rob Pike wrote: > > For a single

Re: [go-nuts] Extra bytes in Gob format

2017-02-28 Thread Sam Whited
On Tue, Feb 28, 2017 at 1:04 AM, Rob Pike wrote: > For a single object, not a struct, it still gets sent as a struct with one > field. The 0 is the marker after the last (only) field is sent. Thanks; that makes sense. So it fits in the grammar description by virtue of being part

[go-nuts] Re: Some best practices for debuging and optimizing with -gcflags?

2017-02-28 Thread 'David Chase' via golang-nuts
Goal "best" practice is that there is no need to tinker with -gcflags, and this is already true for optimization. In practice -gcflags -N tends to make the generated code easier to debug, but that is a sort of a bug that we're trying to fix by improving the compiler's Dwarf generation skills.

Re: [go-nuts] Why is Go Unicode concat so slow compared to Python3 ?

2017-02-28 Thread Shubha Ramani
Ian you nailed it too - thanks for your advice about micro-benchmarks. I will fix them per your suggestion. On Tue, Feb 28, 2017 at 7:41 AM, Shubha Ramani wrote: > Dan thank you so much. Indeed you solved it and thanks for your advice > about the micro-benchmarks > too.

Re: [go-nuts] Why is Go Unicode concat so slow compared to Python3 ?

2017-02-28 Thread Shubha Ramani
Dan thank you so much. Indeed you solved it and thanks for your advice about the micro-benchmarks too. Sincerely, Shubha On Mon, Feb 27, 2017 at 7:25 PM, Dan Kortschak < dan.kortsc...@adelaide.edu.au> wrote: > When the python functions are actually called the comparison is more > reasonable: >

[go-nuts] Re: units disappear from duration at 0.

2017-02-28 Thread peterGo
You are replying to a message from over a year ago. You should review all that has happened since then. For example, https://go-review.googlesource.com/#/c/22357/ https://github.com/golang/go/issues/14058 Things have changed. Peter On Tuesday, February 28, 2017 at 9:29:15 AM UTC-5, andyxning

[go-nuts] Re: units disappear from duration at 0.

2017-02-28 Thread andyxning
This should be good enough to justify what is a zero duration. 在 2016年1月21日星期四 UTC+8下午12:57:26,peterGo写道: > > Simon, > > By design, the Go answer to problems like this is often a simple function. > For example, > > package main > > import ( > "fmt" > "time" > ) > > type DurationZero

[go-nuts] Re: File organization in a github-ed Go project

2017-02-28 Thread Diego Medina
Note that if you write a project that other users would use, you will force them to update their $GOPATH to make your app work. Which I think it a lot worse than making people who fork your project update the import path And like someone else said, if I need to fork a project, I most likely

[go-nuts] Re: Serve large files

2017-02-28 Thread Tamás Gulácsi
A "defer streamPDFbytes.Close()" is missing - you'll run out of file descriptors... -- 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] Re: Serve large files

2017-02-28 Thread Christian Joergensen
Hello, I'd recommend you take a look at: https://godoc.org/net/http#ServeFile This also gives you support for range requests and other goodies. Cheers, Christian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group

Re: [go-nuts] Re: Serve large files

2017-02-28 Thread Jesse McNelis
Try using os.Open to get a *File (which implements io.Reader), and then > io.Copy to the response from the file. > You should use https://golang.org/pkg/net/http/#ServeFile that's what it does. It will also handle requests with range headers for allowing the client to fetch just a part of the

[go-nuts] Re: Serve large files

2017-02-28 Thread Jordan Krage
Try using os.Open to get a *File (which implements io.Reader), and then io.Copy to the response from the file. On Tuesday, February 28, 2017 at 5:13:20 AM UTC-6, Jeffrey Smith wrote: > > I'm trying to server up a file that can be very large so would like to try > and stream the content back. >

[go-nuts] Serve large files

2017-02-28 Thread Jeffrey Smith
I'm trying to server up a file that can be very large so would like to try and stream the content back. package main import ( "bytes" "fmt" //"io" "io/ioutil" "log" "net/http" ) func main() { http.HandleFunc("/", serverFile) if

[go-nuts] Re: File organization in a github-ed Go project

2017-02-28 Thread Basile Starynkevitch
On Monday, February 27, 2017 at 3:18:18 PM UTC+1, Basile Starynkevitch wrote: > > > > On Monday, February 27, 2017 at 3:02:24 PM UTC+1, C Banning wrote: >> >> Try organizing your project as: >> >> monimelt >> >> src >> >> cmd (or "monimelt", if there's just one app) >> >> objvalmo >> >> serial

[go-nuts] Re: correct way to convert wchar_t* to string ?

2017-02-28 Thread Mark
That works perfectly - thanks! On Tuesday, February 28, 2017 at 1:51:49 AM UTC, brainman wrote: > > I would just use syscall.UTF16ToString: > https://play.golang.org/p/jGmQXHtoRT > > Alex > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] How to prevent net/http from canonicalizing request paths?

2017-02-28 Thread tsuna
Hi there, the code in https://github.com/golang/go/blob/go1.8/src/net/http/server.go#L2197 is canonicalizing the request paths such that if you get /foo//bar you get a 301 redirect to /foo/bar. While this is generally what you want, I am dealing with an unfortunate case where /foo//bar and