Re: [go-nuts] Understanding how []byte("astring") works

2021-06-13 Thread 'Axel Wagner' via golang-nuts
Hi, On Mon, Jun 14, 2021 at 2:24 AM Amit Saha wrote: > Hi - My main motivation to understand this is i always had to google > this - how to convert a string to a byte slice. > > Is []byte a type that has been defined in the compiler? > No, but `byte` is. It is a predeclared identifier

Re: [go-nuts] Understanding how []byte("astring") works

2021-06-13 Thread Roland Müller
Hello, Am Mo., 14. Juni 2021 um 03:24 Uhr schrieb Amit Saha : > Hi - My main motivation to understand this is i always had to google > this - how to convert a string to a byte slice. > > Is []byte a type that has been defined in the compiler? > > Or, is that an internal level detail that an earli

[go-nuts] Re: Understanding how []byte("astring") works

2021-06-13 Thread peterGo
Amit, Compilers implement a specification: The Go Programming Language Specification https://golang.org/ref/spec Conversions A conversion changes the type of an expression to the type specified by the conversion. A conversion may appear literally in the source, or it may be implied by the con

[go-nuts] Understanding how []byte("astring") works

2021-06-13 Thread Amit Saha
Hi - My main motivation to understand this is i always had to google this - how to convert a string to a byte slice. Is []byte a type that has been defined in the compiler? Or, is that an internal level detail that an earlier stage (parsing) takes care of when the compiler sees that statement? T

[go-nuts] Re: Question about container/heap

2021-06-13 Thread Brian Candler
On Sunday, 13 June 2021 at 16:09:48 UTC+1 kee...@gmail.com wrote: > For my heap, I never had to Push or Pop, I only had to initialize the heap > and repeatedly "Fix" the top element of the heap. As it turns out the Init > and Fix functions only use the 3 sorting methods of the heap. They don'

[go-nuts] pkg.go.dev question regarding selection of "Latest" version

2021-06-13 Thread Travis Keep
I recently checked in a new version of github.com/keep94/birthday on 12 June. pkg.go.dev sees this new version, yet pkg.go.dev insists that the "latest" version is the one I checked in on the 11 June. The version that I want to be the latest is: v0.0.0-20210612031622-805d2048defa

[go-nuts] Question about container/heap

2021-06-13 Thread Travis Keep
Recently I implemented a heap in GO. To implement a heap, you have to implement Push() and Pop() as well as the 3 methods for sort: Less(),, Swap(), and Len(). For my heap, I never had to Push or Pop, I only had to initialize the heap and repeatedly "Fix" the top element of the heap. As it tu