FYI: It is possible for `done` to never be sent to. For example consider
the following sequence:
goroutine: ch <- 1
main: <- 1
main: run defer
main: fin = atomic load
goroutine: atomic store
main: not 1, return
On Friday, August 18, 2017 at 11:13:36 AM UTC-7, bill@talentinc.com
wrote:
Hi gophers,
I was playing around with a puzzle trying to break the sync package and
found something cool. Can you think of a definition for f that causes
once.Do to execute the argument more than once?
package main
import (
"sync"
)
func main() {
var once sync.Once
var f = // .
It seems that io.SizedReaderAt was added temporarily during the 1.7 cycle,
but promptly removed. I see an standing github issue for it (15822) but it
doesn't seem to have much activity.
I would like to express my hope that it comes back (and hopefully others
will to). A use case that I am i
https://play.golang.org/p/iZTogUaWWl
In the program above, foo and bar compile but baz does not. It fails with
the message: "invalid operation: 1 << b (shift of type float64)". This
seems to be wrong on the surface, since the order of operations should
imply the shift takes precedence. In th
erand alone.
> So in your baz() example, because 1 is an untyped constant, the shift
> expression acts as if 1 is the only operand and converts it to a float64
> type; therefore, 1 has type float64 and you cannot shift. To get around
> this, just use an explicitly typed constant.
&g
Is it safe to call (*testing.M).Run() multiple times within a single
TestMain ? Whether the answer is yes or no, would it be possible to update
the docs to make this clear?
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from t
TL;DR: Is the uintptr slice returned from runtime.Callers always valid?
Reading the docs* for runtime.Callers says: "Callers fills the slice pc
with the return program counters of function invocations on the calling
goroutine's stack. " Does this imply that once the goroutine is gone, or
all
Cgo is not in use; thank you for the quick response!
On Saturday, August 6, 2016 at 11:49:22 AM UTC-7, Ian Lance Taylor wrote:
>
> On Sat, Aug 6, 2016 at 10:08 AM, Carl Mastrangelo
> > wrote:
> > TL;DR: Is the uintptr slice returned from runtime.Callers always valid?
> &g
Hi all,
If you have ever wanted to use the Go httputil.ReverseProxy with HTTP/2, or
do HTTP/2 over Unix Domain Sockets, or do gRPC over plaintext, I made a
package that makes it easy to do:
https://github.com/carl-mastrangelo/h2c
I added some examples to show how to do it, comments welcome
(to short circuit any question, I have already
read https://golang.org/pkg/unsafe/ )
If I create an unsafe.Pointer that points to an invalid memory address, but
I never deference it or otherwise pass it along, what happens to it? Is it
a valid go program to just create such a pointer? The mai
Tue, Aug 21, 2018 at 1:19 PM, 'Carl Mastrangelo' via golang-nuts
> > wrote:
> >
> > If I create an unsafe.Pointer that points to an invalid memory address,
> but
> > I never deference it or otherwise pass it along, what happens to it?
>
> If you never
While trying out the Wasm compiler, I noticed that the syscall/js mainly
has helper functions for converting Go types to Js types, but not the other
way around. I am trying to read the data from an HTML . I add an event listener for the `change` event and want to
read the file contents. The
Hi go nuts,
https://play.golang.org/p/ylYlbVMQ24-
I recently hit an error where I had been calling methods on a struct.
Originally, the fields in the struct were never changed, but after some
iterations, i added some state to my struct. The methods which modified
the state were always work
13 matches
Mail list logo