Re: [go-nuts] base32 DecodeLen() miscalculation when no padding

2017-12-12 Thread Ian Lance Taylor
On Tue, Dec 12, 2017 at 3:13 PM, Jeffrey Goldberg wrote: > >> On Dec 12, 2017, at 9:00 AM, Ian Lance Taylor wrote: > >> DecodedLen is supposed to be applied to the length of the encoded >> data. RFC 4648 says that the encoded data must be padded to be a >>

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Bruno Albuquerque
Why do you want to explicitly use an old go version? Why not 1.9.2? You can find pre-compiled packages for various platforms here: https://golang.org/dl/ On Tue, Dec 12, 2017 at 3:22 PM wrote: > im want test main go compiler. > > so should try >

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Bruno Albuquerque
No the compiler does not generate C code. The compiler compiles Go code to the actual final binary. On Tue, Dec 12, 2017 at 2:28 PM wrote: > so go compiler is made with c. > > so go compiler how work : > -- > so in current golang version , golang generate c

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Bruno Albuquerque
What is expected (assuming the code is correctly written). An executable file is generated and can be run normally. I am sorry but I could not parse your following questions, but I will try some general answers: 1 - No, you do not need a C compiler to compile recent Go versions. You do need an

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Bruno Albuquerque
Go will work fine without a C compiler. Only if you use CGO ( https://blog.golang.org/c-go-cgo) you need one. On Tue, Dec 12, 2017 at 2:51 PM wrote: > so GOLANG will not work, if not install C-Compiler on system. > > yeah? > > > On Wednesday, December 13, 2017 at

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Bruno Albuquerque
Most likely not. The current version was compiled with a previous version that was also written in Go. it you continue going down this chain you eventually get to a Go version that was compiled with a C compiler but this is only needed for platforms that do not have a Go version yet (which is also

[go-nuts] Learning Go: suggestions for code review?

2017-12-12 Thread Ben Hoyt
Hi folks, I've recently been learning Go on the side, so haven't had work colleagues to discuss best practices with. To speed up the learning process, I'm wondering if anyone would like to review the Go code in my side project (a toy language, kind of a cross between JavaScript and Python with

Re: [go-nuts] Inconsistency in gofmt

2017-12-12 Thread Jesse McNelis
On Wed, Dec 13, 2017 at 11:01 AM, Pablo Rozas Larraondo wrote: > Hello, > > I'm curious to know if this is intended: > > https://play.golang.org/p/t353t8ZvL1 This is intentional. gofmt uses spacing to group expressions based on precedence of operators. eg. (i+2)/2 +

[go-nuts] go test/flag.NewFlagSet bug?

2017-12-12 Thread gocss
when I run the minimal program below it errors about NOT knowing -data flag: go test -v -args -data=x flag provided but not defined: -data Usage of /tmp/go-build454762170/github.com/phcurtis/flagexp/_test/flagexp.test: -test.bench regexp blah blah, if you change nfs=false ... and then

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Dave Cheney
In all the supported versions of Go, that is Go 1.9 and soon Go 1.10, the grammar is written in Go. You will find the source here https://github.com/golang/go/tree/master/src/cmd/compile/internal/syntax On Wednesday, 13 December 2017 10:53:45 UTC+11, erfang...@gmail.com wrote: > > im for test ,

Re: [go-nuts] base32 DecodeLen() miscalculation when no padding

2017-12-12 Thread Jeff Goldberg
I apologize for being overly snide in my previous message (below). It's been a rough day. I also failed to focus on an important distinction that may be underlying a point of disagreement. Ian is absolutely correct tools and implementations should be extremely wary of (implicitly) expanding

[go-nuts] Inconsistency in gofmt

2017-12-12 Thread Pablo Rozas Larraondo
Hello, I'm curious to know if this is intended: https://play.golang.org/p/t353t8ZvL1 Line 9 is formatted with spaces but line 10 has no spaces. It seems like adding +1 to the expression changes the behaviour of "gofmt". Wouldn't it be simpler for "gofmt" to always add spaces between the

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
example input: testpackage main import "fmt" func main() { fmt.Println("hello world") } On Wednesday, December 13, 2017 at 3:23:45 AM UTC+3:30, erfang...@gmail.com wrote: > > im for test , want change > > package token lex , to another text. > > example change package to testpackage. > >

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
im for test , want change package token lex , to another text. example change package to testpackage. --- lexer/grammer is write at C or GO? On Wednesday, December 13, 2017 at 3:18:11 AM UTC+3:30, Dave Cheney wrote: > > Sorry, Go 1.4 is no longer supported, it is only

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Dave Cheney
Sorry, Go 1.4 is no longer supported, it is only used for bootstrapping. We will not fix /home/guest/go1.4/src/cmd/cc/cc.y On Wednesday, 13 December 2017 10:41:57 UTC+11, erfang...@gmail.com wrote: > > at go1.4 version. > compiler and lexer,parser is write at C? or GO? > > can check and change

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Dave Cheney
Follow all the steps here, https://groups.google.com/d/msg/golang-nuts/24pSm-B3FqU/a0XYG4SBCgAJ then do this cd $HOME/go/src env GOOS=linux GOARCH=ppc64 ./bootstrap.bash scp ../../go-linux-ppc64-bootstrap.tbz _your host_ ssh _your host # now on the ppc64 host tar xfj

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
at go1.4 version. compiler and lexer,parser is write at C? or GO? can check and change grammer at /home/guest/go1.4/src/cmd/cc/cc.y ? -- 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

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
~/go1.4/bin$ ./go version go version go1.4-bootstrap-20170531 linux/amd64 go1.4 installed. On Wednesday, December 13, 2017 at 3:08:37 AM UTC+3:30, erfang...@gmail.com wrote: > > but i want not install use GOLANG. > only want Go Compiler. > not may? > > On Wednesday, December 13, 2017 at 3:02:10

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
but i want not install use GOLANG. only want Go Compiler. not may? On Wednesday, December 13, 2017 at 3:02:10 AM UTC+3:30, Dave Cheney wrote: > > You need to install Go on an intel computer before preparing the bootstrap > compiler for ppc64. Follow the steps above, you will find bootstrap.bash

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Dave Cheney
Yup. This comes from the heritage of the plan 9 compilers. The plan 9 c compilers were 6c for amd64, 8g for 386, 5g for arm, and so on. Because the go compiler can compile for all those targets it was called gc. People call it gc (lower case) and use GC (upper case) for "garbage collector"

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
Wooow. Question : Name of main go compiler is GC? On Wednesday, December 13, 2017 at 2:59:46 AM UTC+3:30, Dave Cheney wrote: > > Do this > > cd $HOME > curl https://storage.googleapis.com/golang/go1.4-bootstrap-20170531.tar.gz > | tar xz > mv go go1.4 > cd go1.4/src > env CGO_ENABLED=0

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Dave Cheney
You need to install Go on an intel computer before preparing the bootstrap compiler for ppc64. Follow the steps above, you will find bootstrap.bash in the go 1.9.2 sources. On Wednesday, 13 December 2017 10:30:06 UTC+11, erfang...@gmail.com wrote: > > *tutorial* :

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
*tutorial* : *https://golang.org/doc/install/source#go14 is say then run : * $ GOOS=linux GOARCH=ppc64 ./bootstrap.bash - bootstrap.bash filethis file not available at go https://storage.googleapis.com/golang/go1.4-bootstrap-20170531.tar.gz this file only available at new version of golang.

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Dave Cheney
Do this cd $HOME curl https://storage.googleapis.com/golang/go1.4-bootstrap-20170531.tar.gz | tar xz mv go go1.4 cd go1.4/src env CGO_ENABLED=0 ./make.bash cd $HOME git clone https://go.googlesource.com/go cd go/src git checkout go1.9.2 env GOROOT_BOOTSTRAP=$HOME/go1.4 ./make.bash echo

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
at https://storage.googleapis.com/golang/go1.4-bootstrap-20170531.tar.gz source , not available bootstrap.bash file. so bootstrap.bash only available at new version of golang. not at go 1.4. On Wednesday, December 13, 2017 at 2:52:14 AM UTC+3:30, erfang...@gmail.com wrote: > > im want test

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
im want test main go compiler. so should try https://storage.googleapis.com/golang/go1.4-bootstrap-20170531.tar.gz ? and tutorial at https://golang.org/doc/install/source#go14 name of main go compiler is GC? On Wednesday, December 13, 2017 at 2:45:34 AM UTC+3:30, Dave Cheney wrote: > >

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Dave Cheney
Hello, I appreciate that you're frustrated, but you need to follow the installation instructions _exactly_ to the letter or you will not succeed. The installation instructions are quite long, but they are well tested and if you follow them precisely you will be able to install Go on your

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
go-go1.4.3/src/cmd/gc$ make go tool dist install -v make: go: Command not found ../../Make.dist:13: recipe for target 'install' failed make: *** [install] Error 127 so gc also need go!? : On Wednesday, December 13, 2017 at 2:45:34 AM UTC+3:30, Dave

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Dave Cheney
Hello, Thanks for posting. To answer your question 1. The Go compiler used to be written in C, but was rewritten in Go in release 1.5 2. This means that to build a version of Go later than 1.4, you need a Go compiler. 3. The easiest way to do this is to us a version of Go from the golang.org

Re: [go-nuts] base32 DecodeLen() miscalculation when no padding

2017-12-12 Thread Jeffrey Goldberg
> On Dec 12, 2017, at 9:00 AM, Ian Lance Taylor wrote: > DecodedLen is supposed to be applied to the length of the encoded > data. RFC 4648 says that the encoded data must be padded to be a > multiple of 8 bytes. Yet encoding/hash32 defines a NoPadding constant, the code is

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
example , when you want write a hello world application. after this then you are write a `.go` file. you should enter : go build hello.go if not installed c-compiler at now, what happen?! c-compiler need at building golang? or alwayse? also when need use from golang? On Wednesday, December 13,

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread C Banning
Well, there are binary releases for the most HW/OS combinations - https://golang.org/dl/ On Tuesday, December 12, 2017 at 3:51:43 PM UTC-7, erfang...@gmail.com wrote: > > so GOLANG will not work, if not install C-Compiler on system. > > yeah? > > On Wednesday, December 13, 2017 at 2:16:23 AM

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
so GOLANG will not work, if not install C-Compiler on system. yeah? On Wednesday, December 13, 2017 at 2:16:23 AM UTC+3:30, C Banning wrote: > > Well, GO_BOOTSTRAP lets you use any compiler after go1.4. I usually > build/install Go using the previous Go-built version - thus, I >

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread C Banning
Well, GO_BOOTSTRAP lets you use any compiler after go1.4. I usually build/install Go using the previous Go-built version - thus, I built/installed Go1.9 using the Go1.8.1 compiler. On Tuesday, December 12, 2017 at 2:48:57 PM UTC-7, erfang...@gmail.com wrote: > > so Main compiler is at

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
so go compiler is made with c. so go compiler how work : -- so in current golang version , golang generate c code and compile with c-compiler? On Wednesday, December 13, 2017 at 1:49:07 AM UTC+3:30, Shawn Milochik wrote: > > On Tue, Dec 12, 2017 at 4:48 PM,

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
how can use from them? i want not use from GOLANG. only use from GO COMPILER. main compiler of Go: go-go1.4.3/src/cmd/gc/go.y (parser) On Wednesday, December 13, 2017 at 1:49:07 AM UTC+3:30, Shawn Milochik wrote: > > On Tue, Dec 12, 2017 at 4:48 PM, > wrote: > >> so

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Shawn Milochik
On Tue, Dec 12, 2017 at 4:48 PM, wrote: > so Main compiler is at previous version and made with C? > > Yes. https://www.youtube.com/watch?v=QIE5nV5fDwA -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
so Main compiler is at previous version and made with C? On Wednesday, December 13, 2017 at 1:09:13 AM UTC+3:30, Tamás Gulácsi wrote: > > Yes. It compiles itself with a previous verson of the compiler first. -- You received this message because you are subscribed to the Google Groups

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Tamás Gulácsi
Yes. It compiles itself with a previous verson of the compiler first. -- 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.

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
How may a compiler made with itself!? this need a tools at first to build... On Wednesday, December 13, 2017 at 1:00:22 AM UTC+3:30, Ondrej Fabry wrote: > > Not sure what you mean but if you are asking if go compiler generates C > code which is then compiled by gcc then not really. Since version

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Ondrej Fabry
Not sure what you mean but if you are asking if go compiler generates C code which is then compiled by gcc then not really. Since version go 1.5 even the compiler itself is written in pure Go and since then no C code is needed anymore. On Tuesday, December 12, 2017 at 10:03:08 PM UTC+1,

[go-nuts] Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
Hello, Go Compiler How Work at Last Version of GoLang?! i mean Go Compiler , Not GoLang. at the last version of golang. go compiler , generate c code and compile using gcc?! -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

Re: [go-nuts] Re: [urgent] need aguments to justify use of Go for a scientific application

2017-12-12 Thread Jon Conradt
Would you share the document? It likely would save time for others when they have similar tasks. Jon On Wednesday, December 6, 2017 at 4:27:04 PM UTC-8, Christophe Meessen wrote: > > Thank you all for your help. > > I assembled a sort document with the collected arguments (thanks >

Re: [go-nuts] Combine low traffic website

2017-12-12 Thread Andrew
I install the Caddy server and it works great. On Saturday, December 9, 2017 at 8:06:47 AM UTC-8, Matthew Zimmerman wrote: > > You can also code both sites in one go binary then use the sni TLS > extension to determine which website to display. This is exactly how Caddy > and every other

Re: [go-nuts] ABout the note of slice tricks on Go github wiki

2017-12-12 Thread T L
On Tuesday, December 12, 2017 at 9:50:57 AM UTC-5, Jan Mercl wrote: > > On Tue, Dec 12, 2017 at 3:39 PM T L > wrote: > > > Does it still valid for the latest gc? > > In other words, does gc 1.9 still check the segment [len(s), cap[s]) of > a slice s to find active

Re: [go-nuts] base32 DecodeLen() miscalculation when no padding

2017-12-12 Thread Ian Lance Taylor
On Tue, Dec 12, 2017 at 12:06 AM, Jeff Goldberg wrote: > > In encoding/base32 there is, I believe, an off by one error in the > calculation of the size of the buffer needed for DecodeLen() when padding is > turned off. > > // DecodedLen returns the maximum length in bytes of

Re: [go-nuts] ABout the note of slice tricks on Go github wiki

2017-12-12 Thread Jan Mercl
On Tue, Dec 12, 2017 at 3:39 PM T L wrote: > Does it still valid for the latest gc? > In other words, does gc 1.9 still check the segment [len(s), cap[s]) of a slice s to find active pointers? It's not an option, the garbage collector must always scan the whole backing

[go-nuts] Re: For loop in go templating

2017-12-12 Thread Josh Cox
Yep, val see my stackoverflow question for my solution which uses sprig's until On Tuesday, December 12, 2017 at 3:52:13 AM UTC-6, Val wrote: > > Hi Josh > You can add a custom func to iterate over

[go-nuts] ABout the note of slice tricks on Go github wiki

2017-12-12 Thread T L
https://github.com/golang/go/wiki/SliceTricks *NOTE* If the type of the element is a *pointer* or a struct with pointer fields, which need to be garbage collected, the above implementations of Cut and Delete have a potential *memory leak* problem: some elements with values are still referenced

Re: [go-nuts] os.Stat and os.IsNotExist on Windows

2017-12-12 Thread Manlio Perillo
Il giorno lunedì 11 dicembre 2017 19:08:01 UTC+1, Ian Lance Taylor ha scritto: > > On Mon, Dec 11, 2017 at 1:27 AM, Petr Shevtsov > wrote: > > > > I've spotted rather strange behavior of os.IsNotExist on Windows. > > > > This snippet[1] > > > > s :=

Re: [go-nuts] Best way to explicit say sominthing which covers the Go programming languge is not related with Go or Go community

2017-12-12 Thread John McKown
On Tue, Dec 12, 2017 at 8:12 AM, Norbert Fuhs wrote: > Hi, > > I'm writing guide which will cover using the Raspberry Pi with Go with > several small programing projects. > > I would like to know if there is a good way I can make very clear that > this guide is not

[go-nuts] Best way to explicit say sominthing which covers the Go programming languge is not related with Go or Go community

2017-12-12 Thread Norbert Fuhs
Hi, I'm writing guide which will cover using the Raspberry Pi with Go with several small programing projects. I would like to know if there is a good way I can make very clear that this guide is not releated to Google or the Go creators / community etc in general. Is there any text I can

[go-nuts] Re: os.Stat and os.IsNotExist on Windows

2017-12-12 Thread Manlio Perillo
Il giorno lunedì 11 dicembre 2017 17:05:27 UTC+1, Petr Shevtsov ha scritto: > > Greetings, gophers! > > I've spotted rather strange behavior of os.IsNotExist on Windows. > > This snippet[1] > > s := "http://example.com/; > fi, err := os.Stat(s) > if os.IsNotExist(err) { > fmt.Println("Not a file")

Re: [go-nuts] os.Stat and os.IsNotExist on Windows

2017-12-12 Thread Manlio Perillo
Il giorno martedì 12 dicembre 2017 13:24:01 UTC+1, Taru Karttunen ha scritto: > > On 11.12 10:07, Ian Lance Taylor wrote: > > On Mon, Dec 11, 2017 at 1:27 AM, Petr Shevtsov > wrote: > > > s := "http://example.com/; > > > fi, err := os.Stat(s) > > > if

[go-nuts] base32 DecodeLen() miscalculation when no padding

2017-12-12 Thread Jeff Goldberg
In encoding/base32 there is, I believe, an off by one error in the calculation of the size of the buffer needed for DecodeLen() when padding is turned off. // DecodedLen returns the maximum length in bytes of the decoded data // corresponding to n bytes of base32-encoded data. func (enc

Re: [go-nuts] os.Stat and os.IsNotExist on Windows

2017-12-12 Thread Taru Karttunen
On 11.12 10:07, Ian Lance Taylor wrote: > On Mon, Dec 11, 2017 at 1:27 AM, Petr Shevtsov > wrote: > > s := "http://example.com/; > > fi, err := os.Stat(s) > > if os.IsNotExist(err) { > > > > Is this a bug in os.IsNotExist[3] or such behavior is intentional? > > This

[go-nuts] Re: For loop in go templating

2017-12-12 Thread Val
Hi Josh You can add a custom func to iterate over an int : Playground This is similar to the sprig "until" func . On Tuesday, December 12, 2017 at 5:43:06 AM UTC+1, Josh Cox wrote: > > Why is there not a

[go-nuts] Re: net/http GET request with params

2017-12-12 Thread paul . totterman
> > I tried Set and Add. Request.Url.Query() is empty > https://godoc.org/net/url#URL.Query: Query parses RawQuery and returns the corresponding values. > You are changing a copy. q := req.URL.Query() q.Set()... req.URL.RawQuery = q.Encode() Cheers, Paul -- You received this message

[go-nuts] [ANN] astideepspeech: Golang bindings for Mozilla's DeepSpeech speech-to-text library

2017-12-12 Thread Asticode
Hey guys, I'm happy to announce astideepspeech , Golang bindings for Mozilla's DeepSpeech speech-to-text library. Let me know what you think. Cheers -- You received this message because you are subscribed to the Google Groups "golang-nuts"