package main
import "time"
import "fmt"
import "sync/atomic"
func main() {
die := make(chan struct{})
i := int32(0)
closed := func() {
select {
case <-die:
atomic.AddInt32(&i, 1)
default:
close(die)
fmt.Println("closed")
}
On Wednesday, November 1, 2017 at 10:32:21 AM UTC-4, Ian Lance Taylor wrote:
>
> On Wed, Nov 1, 2017 at 4:18 AM, > wrote:
> >
> > Ayan, imagine I am part of a development team. In our program I have a
> > pointer r:
> >
> > r *myType
> >
> > My variable r can be nil, because that is a valid
You can use a main package.
package main
import (
"net/http"
"google.golang.org/appengine"
)
func main() {
http.HandleFunc(...)
appengine.Main()
}
On Wednesday, November 1, 2017 at 12:04:14 AM UTC-7, Tamás Gulácsi wrote:
>
> Just move your main to a realmain pkg, and have a shim th
I hit the same bug
https://github.com/golang/dep/issues/1231
TLDR, you have to use [[override]] when the package is not directly imported by
code in your project.
Protist: github.com/heptio/contour has a working Gopkg.toml, I suggest copying
that into your project and running dep ensure
--
You could file a bug against dep, that's probably the quickest way to get
your issue looked at.
With that said, dep is not expected to work with the Kubernetes client
library right now. I filed
https://github.com/kubernetes/client-go/issues/318 a couple days ago, and
the install instructions just
Hi everyone,
I'm migrating a project from *glide* to *dep* and I'm running into an issue
with *dep* pulling down the wrong revision of a dependency.
I've got the following constraint set in my Gopkg.lock file:
[[constraint]]
name = "github.com/ugorji/go"
revision = "ded73eae5db7e7a0ef6f55aa
On Tue, Oct 31, 2017 at 9:16 PM, Lucio wrote:
>
> That's what I found (I was building as root, if that makes a difference),
> but I was rather surprised to find a "pprof" when the only Go activity I
> still recall from yesterday was a fresh Go build, first go1.4, then go1.9.2.
We need to vendor a
Hi everyone!
Over the last month I've been working on Moka, a mocking framework for Go
[1].
I'm a huge fan of London school TDD and I wasn't satisfied with the current
options, I was missing a lot of the features I liked in tools like
RSpec-Mocks [2] or Mockito [3].
It would be great to get so
If I run `dep ensure` and it doesn't actually pick up any new code, a `go
install -v` will still take a while, presumably because `dep ensure` is
updating the timestamps of stuff, even if it didn't change.
```
$ ls -ld vendor/github.com/behance/go-common/kvwrapper_etcd/
vendor/github.com/behanc
On Wednesday, November 1, 2017 at 6:36:25 PM UTC+2, Felipe da Veiga
Leprevost wrote:
>
> Hey;
>
> I'm developing a pipeline that takes as input XML files with a reasonable
> complex structure and size, the nested structure might have several layers
> and these files can go from 900 MB to 3 GB in
It seems a very bad idea, to require the common case to go through some
package or else get lint-warned.
Checking "x == nil" is the correct way to check whether a value contains a
valid implementation of an interface - and a nil-pointer with the correct
method set is, as far as you should be conce
On 11/01/2017 09:31 AM, Ian Lance Taylor wrote:
On Wed, Nov 1, 2017 at 4:18 AM, wrote:
Ayan, imagine I am part of a development team. In our program I have a
pointer r:
r *myType
My variable r can be nil, because that is a valid situation. It is used in
dozens of places, like this:
if r !
Hey;
I'm developing a pipeline that takes as input XML files with a reasonable
complex structure and size, the nested structure might have several layers
and these files can go from 900 MB to 3 GB in size. I can't change that
because it's not on my control how they are formed, I just need to re
On Wed, Nov 1, 2017 at 7:47 AM, wrote:
>
> Encountered this issue running a statically compiled binary that uses cgo
> (Compiled using go1.8.3). It works OK on one CPU type but not on another.
> The binary is built on a server which is neither of the two below. Is this a
> Go issue or something t
Hello,
Encountered this issue running a statically compiled binary that uses cgo
(Compiled using go1.8.3). It works OK on one CPU type but not on another.
The binary is built on a server which is neither of the two below. Is this
a Go issue or something to do with how the C library is built (gc
On Tue, Oct 31, 2017 at 11:13 PM, Tassadar Liu wrote:
>
> At bottom part of this article: https://golang.org/ref/mem
>
> Should(incorrect idiom):
>
> var a string
> var done bool
>
> func setup() {
> a = "hello, world"
> done = true
> }
>
> func main() {
> go setup()
> for !done {
> }
> print(a)
>
On Wed, Nov 1, 2017 at 4:18 AM, wrote:
>
> Ayan, imagine I am part of a development team. In our program I have a
> pointer r:
>
> r *myType
>
> My variable r can be nil, because that is a valid situation. It is used in
> dozens of places, like this:
>
> if r != nil {
> r.doSomething()
> }
>
On Wednesday, November 1, 2017 at 3:37:54 PM UTC+2, Ayan George wrote:
>
>
>
> On 11/01/2017 07:18 AM, oju...@gmail.com wrote:
> > Ayan, imagine I am part of a development team. In our program I have a
> > pointer r:
> >
> > r *myType
> >
> > My variable r can be nil, because that is a vali
At bottom part of this article: https://golang.org/ref/mem
Should(incorrect idiom):
var a string
var done bool
func setup() {
a = "hello, world"
done = true
}
func main() {
go setup()
for !done {
}
print(a)
}
be:
var a string
var done bool
fu
On 11/01/2017 07:18 AM, oju...@gmail.com wrote:
> Ayan, imagine I am part of a development team. In our program I have a
> pointer r:
>
> r *myType
>
> My variable r can be nil, because that is a valid situation. It is used
> in dozens of places, like this:
>
> if r != nil {
> r.doSomethin
Thanks, really useful!
On Wed, Nov 1, 2017 at 2:18 AM, Hamish Ogilvy wrote:
> Hey Jose,
>
> Yep, might be worth a look at: https://github.com/influxdata/influxql for a
> pretty advanced and open source version. Also look at Rob Pike's calculator
> talk: https://www.youtube.com/watch?v=PXoG0WX0r_E
I have been using https://github.com/FiloSottile/gvt for years, it's great,
simple, you vendor only what you want, so, in this case, that one lib you
are talking about
you can even leave the imports as they are, but point to your own fork of
the repo by modifying the manifest file
for example,
Ayan, imagine I am part of a development team. In our program I have a
pointer r:
r *myType
My variable r can be nil, because that is a valid situation. It is used in
dozens of places, like this:
if r != nil {
r.doSomething()
}
That is a very usual idiom, no only in Go, but in many langua
On 10/31/2017 12:42 PM, oju...@gmail.com wrote:
> Today you can't, Ayan.
>
Right -- I understand that. I'm asking how would you propose Go do
that? What changes would you make to fix this?
I'm asking: If you claim Go is fundamentally broken in this way, how
would you fix it?
-ayan
--
You
Just move your main to a realmain pkg, and have a shim that just calls it.
I used to create a "func Main() error" and a main which calls this, and
log,Fatal on error.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group
25 matches
Mail list logo