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
>> multiple of 8 bytes.
>
> Yet encoding/hash32 defines a NoPadding constant, the code is filled
> with tests for whether the padding has been set to NoPadding, and the package
> docs make reference to setting things with NoPadding.

Yes.  But even with the no padding case, it is impossible to have an
encoded length of a single byte (I tried to say that in a bit of the
message that you didn't quote).  And I hope we can all agree that
`DecodedLen` returns the correct value when called with an argument of
2 when `padChar == NoPadding`.  So we are only talking about the value
1, which I assert is impossible in a valid base32 encoded string with
no padding.

Ian

-- 
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, visit https://groups.google.com/d/optout.


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
> 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:
>
>> 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 website, the instructions are here
>> https://golang.org/doc/install/source#go14
>>
>> 4. If you are new to Go I strongly do not recommend building from source,
>> you should just use one of the pre compiled versions available on the
>> website, they are extremely well tested and known to work on many systems.
>> https://golang.org/doc/install
>>
>> 5. If you are trying to bootstrap Go on a system that we don't ship pre
>> compiled binaries for you will have to produce a bootstrap cross compiler,
>> so you will need to do step 3 then follow the instructions from the step
>> "building go 1.5 from source" on this post,
>> https://dave.cheney.net/2015/10/16/bootstrapping-go-1-5-on-non-intel-platforms
>>
>> real talk, this is quite a complicate process and if english is not your
>> native language you may be better served by finding a Go forum in your
>> native language. I don't have any to recommend off hand, but maybe on the
>> gophers slack you might be able to find someone to help you. Because slack
>> is invite only you can request an invite using this automated application,
>> https://invite.slack.golangbridge.org/
>>
>>
>>
>>
>> On Wednesday, 13 December 2017 10:00:41 UTC+11, C Banning wrote:
>>>
>>> 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 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
> 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 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
> "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, visit https://groups.google.com/d/optout.
>

-- 
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, visit https://groups.google.com/d/optout.


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 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,  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 from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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, visit https://groups.google.com/d/optout.


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 existing compiled Go version though.
2 - You do not need a C compiler to compile Go programs unless you are
making use of CGO.

On Tue, Dec 12, 2017 at 3:12 PM  wrote:

> 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, 2017 at 2:30:41 AM UTC+3:30, C Banning wrote:
>>
>> 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 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
 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 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
> "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, visit https://groups.google.com/d/optout.
>

-- 
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, visit https://groups.google.com/d/optout.


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 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
>> 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 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
> "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, visit https://groups.google.com/d/optout.
>

-- 
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, visit https://groups.google.com/d/optout.


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 not strictly true anymore, as you can technically cross-compile Go
from one existing platform to another one. Even one that Go does not
support yet)

On Tue, Dec 12, 2017 at 1:49 PM  wrote:

> 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
> "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, visit https://groups.google.com/d/optout.
>

-- 
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, visit https://groups.google.com/d/optout.


[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 Go 
syntax). I'm not too interested in a review of the project itself, but 
simply a pure code review to help me grok Go idioms and best practices.

I realize this may be a big request, but any pointers/feedback would be 
useful. Is anyone here interested in giving some feedback? Or if not, is 
there a better place to ask? I'm happy to contribute in a similar way to 
other people's projects too (though I'm more at home in Python right now). 
I thought about the Code Review Stackexchange, but that seems more for 
review of short code snippets.

My project lives at: https://github.com/benhoyt/littlelang

Thanks,
Ben

-- 
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, visit https://groups.google.com/d/optout.


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 + 1 //In this line it's clear that 2 is added to i, that value
is divided by 2 and then added to 1.
(i + 2) / 2 + 1 // The formating here make the order of precedence less clear


> 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 operators? Maybe
> someone knows the reason for this.

-- 
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, visit https://groups.google.com/d/optout.


[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 it uses flag.Parse etc ... code runs 
without issue
but I want to handle error cases in other code I'm working and use  the 
flag.NewFlagSet with go test ...
note the below code in either case works with go run but not with go test.


package main

import (
"flag"
"fmt"
"os"
"testing"
)

var data string
var test func(t *testing.T)
var datainit = "defValue"
var nfs = true

func init() {
if nfs {
flag3 := flag.NewFlagSet("nfs", flag.ContinueOnError)
flag3.StringVar(, "data", datainit, "data")
test = func(t *testing.T) {
fmt.Println("TP1")
err := flag3.Parse(os.Args)
fmt.Printf("data:%v err:%v\n", data, err)
}
return
}
flag.StringVar(, "data", datainit, "data")
test = func(t *testing.T) {
fmt.Println("TP2")
flag.Parse()
fmt.Printf("data:%v\n", data)
}
}

func Test_code(t *testing.T) {
test(t)
}

***
heres full output when nfs=true
paul@t560:~/go/src/github.com/phcurtis/flagexp$ 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
run only benchmarks matching regexp
  -test.benchmem
print memory allocations for benchmarks
  -test.benchtime d
run each benchmark for duration d (default 1s)
  -test.blockprofile file
write a goroutine blocking profile to file
  -test.blockprofilerate rate
set blocking profile rate (see runtime.SetBlockProfileRate) 
(default 1)
  -test.count n
run tests and benchmarks n times (default 1)
  -test.coverprofile file
write a coverage profile to file
  -test.cpu list
comma-separated list of cpu counts to run each test with
  -test.cpuprofile file
write a cpu profile to file
  -test.list regexp
list tests, examples, and benchmarch maching regexp then exit
  -test.memprofile file
write a memory profile to file
  -test.memprofilerate rate
set memory profiling rate (see runtime.MemProfileRate)
  -test.mutexprofile string
write a mutex contention profile to the named file after execution
  -test.mutexprofilefraction int
if >= 0, calls runtime.SetMutexProfileFraction() (default 1)
  -test.outputdir dir
write profiles to dir
  -test.parallel n
run at most n tests in parallel (default 4)
  -test.run regexp
run only tests and examples matching regexp
  -test.short
run smaller test suite to save time
  -test.timeout d
panic test binary after duration d (0 means unlimited)
  -test.trace file
write an execution trace to file
  -test.v
verbose: print additional output
exit status 2
FAILgithub.com/phcurtis/flagexp0.001s

-- 
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, visit https://groups.google.com/d/optout.


[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 , 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 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 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 it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 standards. If I were demanding an RFC 4648 
encoder that also allowed for things that are disallowed by the the RFC, 
then the correct behavior is to fail in some way or another. But I am 
trying to use the advertised to features of encoding/base32 to create a 
non-standard encoding. (In particular, zbase32, which is meant for very 
different uses than the standard encoding.)

Encode/base32 does more than just give us the standard encoders. It offers 
itself as a way to construct some *non*-standard encoders. This is what 
NewEncoding() is all about. But with the math error in DecodedLen, it will 
construct encoders for which the decode(encode(x)) does not equal x.

So as long as encode/base32 offers us NewEncoding() instead of merely 
offering StdEnconding along with allowing some of these new encoders to 
specify no padding, then it should handle the cases where a non-padded 
non-standard base32 works as an encoder should.

Anyway, now that I've done more testing and have had this conversation, I'm 
confident enough that this is a bug that I will file a bug for it.

Cheers,

-j


On Tuesday, December 12, 2017 at 5:13:41 PM UTC-6, Jeff 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 
> > multiple of 8 bytes. 
>
> Yet encoding/hash32 defines a NoPadding constant, the code is filled 
> with tests for whether the padding has been set to NoPadding, and the 
> package 
> docs make reference to setting things with NoPadding. 
>
> There is a lot of logic for that and it can all be made to work with 
>
> --- /usr/local/go/src/encoding/base32/base32.go2017-08-24 
> 16:50:22.0 -0500 
> +++ base32.go2017-12-12 11:26:34.0 -0600 
> @@ -499,8 +499,11 @@ 
>  // corresponding to n bytes of base32-encoded data. 
>  func (enc *Encoding) DecodedLen(n int) int { 
>  if enc.padChar == NoPadding { 
> -return n * 5 / 8 
> +r := n * 5 / 8 
> +if (n*5)%8 != 0 { 
> +return r + 1 
> +} 
> +return r 
>  } 
> - 
>  return n / 8 * 5 
>  } 
>
> > Perhaps DecodedLen should have had an error return, but it's too late 
> > now. 
>
> If you are going to go that route, then it isn’t just DecodedLen that 
> needs to change. Every block of code like 
>
> if enc.padChar == NoPadding { … } 
>
> should be removed; NoPadding should not be defined; and the package 
> documentation must stop claiming this can be set with NoPadding. 
>
> Note that encoding without padding works as expected, but that would 
> have to be removed as well. 
>
> Or, we could simply fix the math in that length calculation. It is already 
> part 
> of a if enc.padChar == NoPadding { } block. It just has a math error. 
>
> > There is no correct value to return to for an impossible input, 
> > so returning 0 seems as good as anything. 
>
> I would really hate to have to fork encoding/hash32 for the stuff 
> that I’m trying to build. Building a zbase32 encoder/decoder was 
> just a call to base32.NewEncoder(). But now it will have to 
> be a call to a forked version. 
>
> Or a math error could be corrected to get the package to behave 
> as clearly intended. 
>
> Cheers, 
>
> -j 
>

-- 
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, visit https://groups.google.com/d/optout.


[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 operators? Maybe
someone knows the reason for this.

Cheers,
Pablo

-- 
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, visit https://groups.google.com/d/optout.


[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.
>
> ---
>
> 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 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 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 it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 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 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 it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 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 it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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-linux-ppc64-bootstrap.tbz 
git clone https://go.googlesource.com/go 
cd go/src
git checkout go1.9.2
env GOROOT_BOOTSTRAP=$HOME/go-linux-ppc64-bootstrap ./make.bash
echo '$PATH=$PATH:$HOME/go/bin' >> ~/.profile
source ~/.profile

On Wednesday, 13 December 2017 10:39:20 UTC+11, erfang...@gmail.com wrote:
>
> ~/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 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 in the go 1.9.2 sources.
>>>
>>> On Wednesday, 13 December 2017 10:30:06 UTC+11, erfang...@gmail.com 
>>> wrote:

 *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.


 On Wednesday, December 13, 2017 at 2:52:14 AM UTC+3:30, 
 erfang...@gmail.com wrote:
>
> 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:
>>
>> 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 website, the instructions are here 
>> https://golang.org/doc/install/source#go14
>>
>> 4. If you are new to Go I strongly do not recommend building from 
>> source, you should just use one of the pre compiled versions available 
>> on 
>> the website, they are extremely well tested and known to work on many 
>> systems. https://golang.org/doc/install
>>
>> 5. If you are trying to bootstrap Go on a system that we don't ship 
>> pre compiled binaries for you will have to produce a bootstrap cross 
>> compiler, so you will need to do step 3 then follow the instructions 
>> from 
>> the step "building go 1.5 from source" on this post, 
>> https://dave.cheney.net/2015/10/16/bootstrapping-go-1-5-on-non-intel-platforms
>>
>> real talk, this is quite a complicate process and if english is not 
>> your native language you may be better served by finding a Go forum in 
>> your 
>> native language. I don't have any to recommend off hand, but maybe on 
>> the 
>> gophers slack you might be able to find someone to help you. Because 
>> slack 
>> is invite only you can request an invite using this automated 
>> application, 
>> https://invite.slack.golangbridge.org/
>>
>>
>>
>>
>> On Wednesday, 13 December 2017 10:00:41 UTC+11, C Banning wrote:
>>>
>>> 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 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 
> 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 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 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 it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 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 in the go 1.9.2 sources.
>>
>> On Wednesday, 13 December 2017 10:30:06 UTC+11, erfang...@gmail.com 
>> wrote:
>>>
>>> *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.
>>>
>>>
>>> On Wednesday, December 13, 2017 at 2:52:14 AM UTC+3:30, 
>>> erfang...@gmail.com wrote:

 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:
>
> 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 website, the instructions are here 
> https://golang.org/doc/install/source#go14
>
> 4. If you are new to Go I strongly do not recommend building from 
> source, you should just use one of the pre compiled versions available on 
> the website, they are extremely well tested and known to work on many 
> systems. https://golang.org/doc/install
>
> 5. If you are trying to bootstrap Go on a system that we don't ship 
> pre compiled binaries for you will have to produce a bootstrap cross 
> compiler, so you will need to do step 3 then follow the instructions from 
> the step "building go 1.5 from source" on this post, 
> https://dave.cheney.net/2015/10/16/bootstrapping-go-1-5-on-non-intel-platforms
>
> real talk, this is quite a complicate process and if english is not 
> your native language you may be better served by finding a Go forum in 
> your 
> native language. I don't have any to recommend off hand, but maybe on the 
> gophers slack you might be able to find someone to help you. Because 
> slack 
> is invite only you can request an invite using this automated 
> application, 
> https://invite.slack.golangbridge.org/
>
>
>
>
> On Wednesday, 13 December 2017 10:00:41 UTC+11, C Banning wrote:
>>
>> 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 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 
 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 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 
"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, visit https://groups.google.com/d/optout.


[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 in 
> the go 1.9.2 sources.
>
> On Wednesday, 13 December 2017 10:30:06 UTC+11, erfang...@gmail.com wrote:
>>
>> *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.
>>
>>
>> On Wednesday, December 13, 2017 at 2:52:14 AM UTC+3:30, 
>> erfang...@gmail.com wrote:
>>>
>>> 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:

 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 website, the instructions are here 
 https://golang.org/doc/install/source#go14

 4. If you are new to Go I strongly do not recommend building from 
 source, you should just use one of the pre compiled versions available on 
 the website, they are extremely well tested and known to work on many 
 systems. https://golang.org/doc/install

 5. If you are trying to bootstrap Go on a system that we don't ship pre 
 compiled binaries for you will have to produce a bootstrap cross compiler, 
 so you will need to do step 3 then follow the instructions from the step 
 "building go 1.5 from source" on this post, 
 https://dave.cheney.net/2015/10/16/bootstrapping-go-1-5-on-non-intel-platforms

 real talk, this is quite a complicate process and if english is not 
 your native language you may be better served by finding a Go forum in 
 your 
 native language. I don't have any to recommend off hand, but maybe on the 
 gophers slack you might be able to find someone to help you. Because slack 
 is invite only you can request an invite using this automated application, 
 https://invite.slack.golangbridge.org/




 On Wednesday, 13 December 2017 10:00:41 UTC+11, C Banning wrote:
>
> 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 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 
>>> 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 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 
"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, visit https://groups.google.com/d/optout.


[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"

On Wednesday, 13 December 2017 10:33:17 UTC+11, erfang...@gmail.com wrote:
>
> 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 ./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 '$PATH=$PATH:$HOME/go/bin" >> ~/.profile
>> source ~/.profile
>>
>>
>> On Wednesday, 13 December 2017 10:22:14 UTC+11, erfang...@gmail.com 
>> wrote:
>>>
>>> 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:

 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 website, the instructions are here 
 https://golang.org/doc/install/source#go14

 4. If you are new to Go I strongly do not recommend building from 
 source, you should just use one of the pre compiled versions available on 
 the website, they are extremely well tested and known to work on many 
 systems. https://golang.org/doc/install

 5. If you are trying to bootstrap Go on a system that we don't ship pre 
 compiled binaries for you will have to produce a bootstrap cross compiler, 
 so you will need to do step 3 then follow the instructions from the step 
 "building go 1.5 from source" on this post, 
 https://dave.cheney.net/2015/10/16/bootstrapping-go-1-5-on-non-intel-platforms

 real talk, this is quite a complicate process and if english is not 
 your native language you may be better served by finding a Go forum in 
 your 
 native language. I don't have any to recommend off hand, but maybe on the 
 gophers slack you might be able to find someone to help you. Because slack 
 is invite only you can request an invite using this automated application, 
 https://invite.slack.golangbridge.org/




 On Wednesday, 13 December 2017 10:00:41 UTC+11, C Banning wrote:
>
> 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 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 
>>> 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 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 
"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, visit https://groups.google.com/d/optout.


[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 ./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 '$PATH=$PATH:$HOME/go/bin" >> ~/.profile
> source ~/.profile
>
>
> On Wednesday, 13 December 2017 10:22:14 UTC+11, erfang...@gmail.com wrote:
>>
>> 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:
>>>
>>> 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 website, the instructions are here 
>>> https://golang.org/doc/install/source#go14
>>>
>>> 4. If you are new to Go I strongly do not recommend building from 
>>> source, you should just use one of the pre compiled versions available on 
>>> the website, they are extremely well tested and known to work on many 
>>> systems. https://golang.org/doc/install
>>>
>>> 5. If you are trying to bootstrap Go on a system that we don't ship pre 
>>> compiled binaries for you will have to produce a bootstrap cross compiler, 
>>> so you will need to do step 3 then follow the instructions from the step 
>>> "building go 1.5 from source" on this post, 
>>> https://dave.cheney.net/2015/10/16/bootstrapping-go-1-5-on-non-intel-platforms
>>>
>>> real talk, this is quite a complicate process and if english is not your 
>>> native language you may be better served by finding a Go forum in your 
>>> native language. I don't have any to recommend off hand, but maybe on the 
>>> gophers slack you might be able to find someone to help you. Because slack 
>>> is invite only you can request an invite using this automated application, 
>>> https://invite.slack.golangbridge.org/
>>>
>>>
>>>
>>>
>>> On Wednesday, 13 December 2017 10:00:41 UTC+11, C Banning wrote:

 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 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 
>> 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 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 
"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, visit https://groups.google.com/d/optout.


[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* : *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.
>
>
> On Wednesday, December 13, 2017 at 2:52:14 AM UTC+3:30, 
> erfang...@gmail.com wrote:
>>
>> 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:
>>>
>>> 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 website, the instructions are here 
>>> https://golang.org/doc/install/source#go14
>>>
>>> 4. If you are new to Go I strongly do not recommend building from 
>>> source, you should just use one of the pre compiled versions available on 
>>> the website, they are extremely well tested and known to work on many 
>>> systems. https://golang.org/doc/install
>>>
>>> 5. If you are trying to bootstrap Go on a system that we don't ship pre 
>>> compiled binaries for you will have to produce a bootstrap cross compiler, 
>>> so you will need to do step 3 then follow the instructions from the step 
>>> "building go 1.5 from source" on this post, 
>>> https://dave.cheney.net/2015/10/16/bootstrapping-go-1-5-on-non-intel-platforms
>>>
>>> real talk, this is quite a complicate process and if english is not your 
>>> native language you may be better served by finding a Go forum in your 
>>> native language. I don't have any to recommend off hand, but maybe on the 
>>> gophers slack you might be able to find someone to help you. Because slack 
>>> is invite only you can request an invite using this automated application, 
>>> https://invite.slack.golangbridge.org/
>>>
>>>
>>>
>>>
>>> On Wednesday, 13 December 2017 10:00:41 UTC+11, C Banning wrote:

 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 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 
>> 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 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 
"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, visit https://groups.google.com/d/optout.


[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.


On Wednesday, December 13, 2017 at 2:52:14 AM UTC+3:30, erfang...@gmail.com 
wrote:
>
> 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:
>>
>> 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 website, the instructions are here 
>> https://golang.org/doc/install/source#go14
>>
>> 4. If you are new to Go I strongly do not recommend building from source, 
>> you should just use one of the pre compiled versions available on the 
>> website, they are extremely well tested and known to work on many systems. 
>> https://golang.org/doc/install
>>
>> 5. If you are trying to bootstrap Go on a system that we don't ship pre 
>> compiled binaries for you will have to produce a bootstrap cross compiler, 
>> so you will need to do step 3 then follow the instructions from the step 
>> "building go 1.5 from source" on this post, 
>> https://dave.cheney.net/2015/10/16/bootstrapping-go-1-5-on-non-intel-platforms
>>
>> real talk, this is quite a complicate process and if english is not your 
>> native language you may be better served by finding a Go forum in your 
>> native language. I don't have any to recommend off hand, but maybe on the 
>> gophers slack you might be able to find someone to help you. Because slack 
>> is invite only you can request an invite using this automated application, 
>> https://invite.slack.golangbridge.org/
>>
>>
>>
>>
>> On Wednesday, 13 December 2017 10:00:41 UTC+11, C Banning wrote:
>>>
>>> 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 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 
> 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 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 
"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, visit https://groups.google.com/d/optout.


[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 '$PATH=$PATH:$HOME/go/bin" >> ~/.profile
source ~/.profile


On Wednesday, 13 December 2017 10:22:14 UTC+11, erfang...@gmail.com wrote:
>
> 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:
>>
>> 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 website, the instructions are here 
>> https://golang.org/doc/install/source#go14
>>
>> 4. If you are new to Go I strongly do not recommend building from source, 
>> you should just use one of the pre compiled versions available on the 
>> website, they are extremely well tested and known to work on many systems. 
>> https://golang.org/doc/install
>>
>> 5. If you are trying to bootstrap Go on a system that we don't ship pre 
>> compiled binaries for you will have to produce a bootstrap cross compiler, 
>> so you will need to do step 3 then follow the instructions from the step 
>> "building go 1.5 from source" on this post, 
>> https://dave.cheney.net/2015/10/16/bootstrapping-go-1-5-on-non-intel-platforms
>>
>> real talk, this is quite a complicate process and if english is not your 
>> native language you may be better served by finding a Go forum in your 
>> native language. I don't have any to recommend off hand, but maybe on the 
>> gophers slack you might be able to find someone to help you. Because slack 
>> is invite only you can request an invite using this automated application, 
>> https://invite.slack.golangbridge.org/
>>
>>
>>
>>
>> On Wednesday, 13 December 2017 10:00:41 UTC+11, C Banning wrote:
>>>
>>> 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 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 
> 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 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 
"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, visit https://groups.google.com/d/optout.


[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 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:
>>
>> 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 website, the instructions are here 
>> https://golang.org/doc/install/source#go14
>>
>> 4. If you are new to Go I strongly do not recommend building from source, 
>> you should just use one of the pre compiled versions available on the 
>> website, they are extremely well tested and known to work on many systems. 
>> https://golang.org/doc/install
>>
>> 5. If you are trying to bootstrap Go on a system that we don't ship pre 
>> compiled binaries for you will have to produce a bootstrap cross compiler, 
>> so you will need to do step 3 then follow the instructions from the step 
>> "building go 1.5 from source" on this post, 
>> https://dave.cheney.net/2015/10/16/bootstrapping-go-1-5-on-non-intel-platforms
>>
>> real talk, this is quite a complicate process and if english is not your 
>> native language you may be better served by finding a Go forum in your 
>> native language. I don't have any to recommend off hand, but maybe on the 
>> gophers slack you might be able to find someone to help you. Because slack 
>> is invite only you can request an invite using this automated application, 
>> https://invite.slack.golangbridge.org/
>>
>>
>>
>>
>> On Wednesday, 13 December 2017 10:00:41 UTC+11, C Banning wrote:
>>>
>>> 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 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 
> 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 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 
"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, visit https://groups.google.com/d/optout.


[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:
>
> 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 
> website, the instructions are here 
> https://golang.org/doc/install/source#go14
>
> 4. If you are new to Go I strongly do not recommend building from source, 
> you should just use one of the pre compiled versions available on the 
> website, they are extremely well tested and known to work on many systems. 
> https://golang.org/doc/install
>
> 5. If you are trying to bootstrap Go on a system that we don't ship pre 
> compiled binaries for you will have to produce a bootstrap cross compiler, 
> so you will need to do step 3 then follow the instructions from the step 
> "building go 1.5 from source" on this post, 
> https://dave.cheney.net/2015/10/16/bootstrapping-go-1-5-on-non-intel-platforms
>
> real talk, this is quite a complicate process and if english is not your 
> native language you may be better served by finding a Go forum in your 
> native language. I don't have any to recommend off hand, but maybe on the 
> gophers slack you might be able to find someone to help you. Because slack 
> is invite only you can request an invite using this automated application, 
> https://invite.slack.golangbridge.org/
>
>
>
>
> On Wednesday, 13 December 2017 10:00:41 UTC+11, C Banning wrote:
>>
>> 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 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 
 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 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 
"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, visit https://groups.google.com/d/optout.


[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 
computer.

On Wednesday, 13 December 2017 10:18:22 UTC+11, erfang...@gmail.com wrote:
>
> 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 Cheney wrote:
>>
>> 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 website, the instructions are here 
>> https://golang.org/doc/install/source#go14
>>
>> 4. If you are new to Go I strongly do not recommend building from source, 
>> you should just use one of the pre compiled versions available on the 
>> website, they are extremely well tested and known to work on many systems. 
>> https://golang.org/doc/install
>>
>> 5. If you are trying to bootstrap Go on a system that we don't ship pre 
>> compiled binaries for you will have to produce a bootstrap cross compiler, 
>> so you will need to do step 3 then follow the instructions from the step 
>> "building go 1.5 from source" on this post, 
>> https://dave.cheney.net/2015/10/16/bootstrapping-go-1-5-on-non-intel-platforms
>>
>> real talk, this is quite a complicate process and if english is not your 
>> native language you may be better served by finding a Go forum in your 
>> native language. I don't have any to recommend off hand, but maybe on the 
>> gophers slack you might be able to find someone to help you. Because slack 
>> is invite only you can request an invite using this automated application, 
>> https://invite.slack.golangbridge.org/
>>
>>
>>
>>
>> On Wednesday, 13 December 2017 10:00:41 UTC+11, C Banning wrote:
>>>
>>> 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 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 
> 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 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 
"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, visit https://groups.google.com/d/optout.


[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 Cheney wrote:
>
> 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 
> website, the instructions are here 
> https://golang.org/doc/install/source#go14
>
> 4. If you are new to Go I strongly do not recommend building from source, 
> you should just use one of the pre compiled versions available on the 
> website, they are extremely well tested and known to work on many systems. 
> https://golang.org/doc/install
>
> 5. If you are trying to bootstrap Go on a system that we don't ship pre 
> compiled binaries for you will have to produce a bootstrap cross compiler, 
> so you will need to do step 3 then follow the instructions from the step 
> "building go 1.5 from source" on this post, 
> https://dave.cheney.net/2015/10/16/bootstrapping-go-1-5-on-non-intel-platforms
>
> real talk, this is quite a complicate process and if english is not your 
> native language you may be better served by finding a Go forum in your 
> native language. I don't have any to recommend off hand, but maybe on the 
> gophers slack you might be able to find someone to help you. Because slack 
> is invite only you can request an invite using this automated application, 
> https://invite.slack.golangbridge.org/
>
>
>
>
> On Wednesday, 13 December 2017 10:00:41 UTC+11, C Banning wrote:
>>
>> 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 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 
 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 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 
"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, visit https://groups.google.com/d/optout.


[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 
website, the instructions are here 
https://golang.org/doc/install/source#go14

4. If you are new to Go I strongly do not recommend building from source, 
you should just use one of the pre compiled versions available on the 
website, they are extremely well tested and known to work on many 
systems. https://golang.org/doc/install

5. If you are trying to bootstrap Go on a system that we don't ship pre 
compiled binaries for you will have to produce a bootstrap cross compiler, 
so you will need to do step 3 then follow the instructions from the step 
"building go 1.5 from source" on this 
post, 
https://dave.cheney.net/2015/10/16/bootstrapping-go-1-5-on-non-intel-platforms

real talk, this is quite a complicate process and if english is not your 
native language you may be better served by finding a Go forum in your 
native language. I don't have any to recommend off hand, but maybe on the 
gophers slack you might be able to find someone to help you. Because slack 
is invite only you can request an invite using this automated 
application, https://invite.slack.golangbridge.org/




On Wednesday, 13 December 2017 10:00:41 UTC+11, C Banning wrote:
>
> 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 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 
>>> 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 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 
"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, visit https://groups.google.com/d/optout.


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 filled
with tests for whether the padding has been set to NoPadding, and the package
docs make reference to setting things with NoPadding.

There is a lot of logic for that and it can all be made to work with

--- /usr/local/go/src/encoding/base32/base32.go 2017-08-24 16:50:22.0 
-0500
+++ base32.go   2017-12-12 11:26:34.0 -0600
@@ -499,8 +499,11 @@
 // corresponding to n bytes of base32-encoded data.
 func (enc *Encoding) DecodedLen(n int) int {
if enc.padChar == NoPadding {
-   return n * 5 / 8
+   r := n * 5 / 8
+   if (n*5)%8 != 0 {
+   return r + 1
+   }
+   return r
}
-
return n / 8 * 5
 }

> Perhaps DecodedLen should have had an error return, but it's too late
> now.

If you are going to go that route, then it isn’t just DecodedLen that
needs to change. Every block of code like

if enc.padChar == NoPadding { … }

should be removed; NoPadding should not be defined; and the package
documentation must stop claiming this can be set with NoPadding.

Note that encoding without padding works as expected, but that would
have to be removed as well.

Or, we could simply fix the math in that length calculation. It is already part
of a if enc.padChar == NoPadding { } block. It just has a math error.

> There is no correct value to return to for an impossible input,
> so returning 0 seems as good as anything.

I would really hate to have to fork encoding/hash32 for the stuff
that I’m trying to build. Building a zbase32 encoder/decoder was
just a call to base32.NewEncoder(). But now it will have to
be a call to a forked version.

Or a math error could be corrected to get the package to behave
as clearly intended.

Cheers,

-j

-- 
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, visit https://groups.google.com/d/optout.


smime.p7s
Description: S/MIME cryptographic signature


[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, 2017 at 2:30:41 AM UTC+3:30, C Banning wrote:
>
> 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 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 
>>> 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 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 
"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, visit https://groups.google.com/d/optout.


[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 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 
>> 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 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 
"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, visit https://groups.google.com/d/optout.


[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 
> 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 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 
"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, visit https://groups.google.com/d/optout.


[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 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 
"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, visit https://groups.google.com/d/optout.


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,  
> 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 from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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 from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 
"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, visit https://groups.google.com/d/optout.


[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.
For more options, visit https://groups.google.com/d/optout.


[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 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, erfang...@gmail.com 
> wrote:
>>
>> 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 from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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, erfang...@gmail.com 
wrote:
>
> 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 from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 
> Sebastien). 
>
> It also contains short code samples. 
>
> Le 06/12/2017 à 16:17, Jesper Louis Andersen a écrit :
>
> The best point in time to switch languages are when one of the following 
> things is happening:
>
> * There is a small experiment on the side of the larger system which can 
> be handled in another language.
> * There is a large project which has failed internally in the business, it 
> is severely behind and nobody thinks it can be solved anyway.
>
> The by far best situation is when the sky is falling. This is when you can 
> propose a solution to the problem rather than a language. The solution then 
> proves itself first and then the language decision follows as part of the 
> solution.
>
> However, for your situation, analyze the requirements of the project 
> first, then make a real effort to analyze a Python solution against a Go 
> solution. If astrophysicists are likely to grab e.g., numpy to do their 
> image processing loop, it is a hard sell. OTOH, if you have to serve a 
> serious amount of image data then the concurrency of Go is a better choice 
> and so on. Quantify "how many images per minute", "how many concurrent 
> requests", "resource usage" and so on.
>
> You could also look for a split solution: process the images in Python, 
> but serve them from Go?
>
> To me, the two biggest weaknesses of Python in (industrial) production 
> settings are:
>
> * Dynamic typing and no other program modularization leads to programs 
> that are really hard to maintain, especially as they grow. A small 
> machine-learning training script is easy enough to maintain as a 
> work-sheet, but I don't particularly like it for serving said 
> machine-learning model.
> * Deployment often requires some hoop-jumping. Getting the right software 
> versions built on one machine and deployed on another is IMO living hell 
> for Python programs. My experience is that build pipelines for Python 
> systems often break in subtle ways. Go produces static binaries which are 
> much easier to handle (Other systems doing it right: Haskell, Erlang, 
> OCaml, Elixir, ...)
>
>
> On Wed, Dec 6, 2017 at 2:34 PM Christophe Meessen  > wrote:
>
>> Thanks far all the answers. Sebastien Binet is a colleague and he is 
>> indeed brilliant. 
>> pachyderm looks powerful, but also an overkill for my need. It might 
>> scare my colleagues away. 
>>
>> Le 06/12/2017 à 12:34, Henrik Johansson a écrit :
>>
>> I have a vague memory of +Rob Pike  tweeting something 
>> about astronomy or perhaps an observatory a few months ago.
>> Perhaps there was no programming involved but if so I imagine Go is safe 
>> bet.
>>
>> But building pipelines using something like Pachyderm would allow for a 
>> very polyglot "use the tool that fits in each part" approach.
>>
>>
>> ons 6 dec. 2017 kl 11:43 skrev Volker Dobler > >:
>>
>>> I know about https://go-hep.org probably Sebastien can elaborate more 
>>> if and how it is used at CERN.
>>>
>>> V.
>>>
>>>
>>> On Wednesday, 6 December 2017 10:56:01 UTC+1, Christophe Meessen wrote: 

 Hello, 

 I'm a computer scientist in charge of developing an image processing 
 pipeline for telescope images. 
 It will also have a web server and DB connection.

 The project is going through reviews by external experts, and the 
 problem I'm facing is that my proposal to use Go is about to be rejected. 

 The main opposing arguments are 
 - everybody uses python in astrophysics
 - it is very easy to find someone who knows python
 - risk that I, sole Go programmer, might become unavailable

 I would have the same arguments if I was project leader and unfamiliar 
 with Go. 

 The counter arguments I found so far are that
 - Go is simpler and safer than Python
 - I learned Go in a week-end

 The problem is that they don't convince people who don't know Go, are 
 not experienced software developers, and don't want to do the due 
 diligence. 
 It's the usual inertia to change.  

 What other arguments could I use ?

 Do you know other significant scientific experiments that have adopted 
 Go ? 



 I have found this github project. 
 https://github.com/indigo-astronomy/indigo
 INDI is a well known Python Observatory Control System. 
 INDIGO is its translation into Go. 

 I have also found SciPipe https://github.com/scipipe.
 It is a Go pipeline framework used in scientific applications. 


 -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "golang-nuts" group.
>>> To 

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 reverse proxy does it.
>

Thanks Matthew, this is what I want at first. Can you please show me some 
code snippet on how to do it? 

-- 
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, visit https://groups.google.com/d/optout.


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 pointers?
>
> It's not an option, the garbage collector must always scan the whole 
> backing array.
>
>
>
> -- 
>
> -j
>

Thanks for the confirmation. 

-- 
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, visit https://groups.google.com/d/optout.


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 the decoded data
>   // corresponding to n bytes of base32-encoded data.
>   func (enc *Encoding) DecodedLen(n int) int {
>   if enc.padChar == NoPadding {
>   return n * 5 / 8
>   }
>
>   return n / 8 * 5
>   }
>
>
> Note that when n is 1, that leads to a DecodeLen() returning zero. Likewise,
> when n is 2, we get a DecodeLen of 1.
>
> This leads to incorrect decoding, as the size of dbuf is wrong in
> DecodeString().
>
> If needed, I can construct tests showing this, but what I have at the moment
> (how I stumbled across this) isn't going to
> be very useful.

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.  So when using padding, values of 1 or 2 should
never happen.  When not using padding, a minimum of two encoded bytes
is needed to represent a single decoded byte.  So a value of 1 should
never happen.

Perhaps DecodedLen should have had an error return, but it's too late
now.  There is no correct value to return to for an impossible input,
so returning 0 seems as good as anything.

Ian

-- 
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, visit https://groups.google.com/d/optout.


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 array.



-- 

-j

-- 
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, visit https://groups.google.com/d/optout.


[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 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 'for' action in go templating 
>> ?
>>
>> I seem to get punted for asking such blasphemy!
>>
>> my stackoverflow question 
>> 
>>
>> and my [github issue](
>> https://github.com/golang/go/issues/23088#issuecomment-350871434)
>>
>> But it's a serious question, the range action does not seem to fit what I 
>> want here ( which is a simple loop over a count ).
>>
>

-- 
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, visit https://groups.google.com/d/optout.


[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 by slice a and thus can not be collected. The 
following code can fix this problem:

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?

-- 
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, visit https://groups.google.com/d/optout.


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 := "http://example.com/; 
> > fi, err := os.Stat(s) 
> > if os.IsNotExist(err) { 
> > fmt.Println("Not a file") 
> > return 
> > } 
> > mode := fi.Mode() 
> > if mode.IsRegular() { 
> > fmt.Println("File") 
> > } 
> > 
> > works perfectly on Linux but panics on Windows. 
> > 
> > This happens because of os.Stat returns an error "CreateFile 
> > http://example.com/: The filename, directory name, or volume label 
> syntax is 
> > incorrect." (errno 123[2]) for such input, but os.IsNotExist(err) 
> returns 
> > false. 
> > 
> > Is this a bug in os.IsNotExist[3] or such behavior is intentional? 
>
> This sounds like a bug, although it may not be easy to fix.  Please 
> open an bug report at https://golang.org/issue.  Thanks. 
>
>
I have opened the bug #23105.

See also #18974.

Currently on UNIX systems isNotExist only checks for ENOENT, but what about 
ELOOP, ENAMETOOLONG and ENOTDIR?
EACCESS and EOVERFLOW are more subtle, but probably the problem is trying 
to use os.IsNotExist after calling os.Stat to check if a file does not 
exist.

To check if a file does not exist the correct way is, IMHO, to check if 
os.Stat returns an error; this is what Python os.path.exists do.


Manlio 

-- 
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, visit https://groups.google.com/d/optout.


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 releated to Google or the Go creators / community etc in
> general.
>
> Is there any text I can make this clear before I release something and I
> get sued?
>

​Well, if you're really worried about being sued, I'd suggest consulting a
lawyer with appropriate legal expertise (I.e. don't hire a "fix your
tickets!" lawyer).

I have read some disclaimers which basically say something along the lines
of:

This document and its contents are entirely the product o​f .
The information herein is not endorsed or supported by anyone else,
including but not limited to Google, the Go community, .  The
author disavows any responsibility for any actions taken by any person,
company, or other entity based on information contained in this document.

​Again. I am NOT a lawyer. The above is NOT legal advice.​ I do NOT claim
that the above has any legal standing in any jurisdiction.

If you want, you might do a search on "legal disclaimer" to get more ideas.



>
> Best,
>
> Norbert
>
>
-- 
I have a theory that it's impossible to prove anything, but I can't prove
it.

Maranatha! <><
John McKown

-- 
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, visit https://groups.google.com/d/optout.


[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 make this clear before I release something and I 
get sued?

Best,

Norbert

-- 
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, visit https://groups.google.com/d/optout.


[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")
> return
> }
> mode := fi.Mode()
> if mode.IsRegular() {
> fmt.Println("File")
> }
>
> works perfectly on Linux but panics on Windows.
>
>
Note that your code is incorrect, since you access fi when os.Stat returns 
a non nil error.

> [...]


Manlio Perillo

-- 
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, visit https://groups.google.com/d/optout.


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 os.IsNotExist(err) { 
> > > 
> > > Is this a bug in os.IsNotExist[3] or such behavior is intentional? 
> > 
> > This sounds like a bug, although it may not be easy to fix.  Please 
> > open an bug report at https://golang.org/issue.  Thanks. 
>
> Isn't this just case of a path that is valid on Linux and invalid on 
> Windows? Invalid paths don't match IsNotExist on Linux either (e.g. 
> ENAMETOOLONG). 
>

Yes.

https://play.golang.org/p/7xo02WfeHR


Manlio Perillo

-- 
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, visit https://groups.google.com/d/optout.


[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 *Encoding) 
DecodedLen(n int) int {if enc.padChar == NoPadding {   return n 
* 5 / 8}   return n / 8 * 5  }  

Note that when n is 1, that leads to a DecodeLen() returning zero. 
Likewise, when n is 2, we get a DecodeLen of 1.

This leads to incorrect decoding, as the size of dbuf is wrong in 
DecodeString().

If needed, I can construct tests showing this, but what I have at the 
moment (how I stumbled across this) isn't going to
be very useful.

-- 
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, visit https://groups.google.com/d/optout.


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 sounds like a bug, although it may not be easy to fix.  Please
> open an bug report at https://golang.org/issue.  Thanks.

Isn't this just case of a path that is valid on Linux and invalid on
Windows? Invalid paths don't match IsNotExist on Linux either (e.g.
ENAMETOOLONG).

- Taru Karttunen

-- 
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, visit https://groups.google.com/d/optout.


[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 'for' action in go templating 
> ?
>
> I seem to get punted for asking such blasphemy!
>
> my stackoverflow question 
> 
>
> and my [github issue](
> https://github.com/golang/go/issues/23088#issuecomment-350871434)
>
> But it's a serious question, the range action does not seem to fit what I 
> want here ( which is a simple loop over a count ).
>

-- 
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, visit https://groups.google.com/d/optout.


[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 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, visit https://groups.google.com/d/optout.


[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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.