<-done
lock.Lock()
(*visited)[result] = true
lock.Unlock()
ch <- result
}
}
}
}
func getHrefTag(token html.Token) (result string, ok bool) {
for _, a := range token.Attr {
if a.Key == "href"
Newbie here everyone.
I am trying to remove a struct value from a slice, which consists of
elements of the same type. Let's say the type is defined as below:
type connInfo struct {
ipAddr string
name string
conn net.Conn
}
Now I have a remove function, in which there is a for loop
Thanks I also worried that at the beginning. But when I use this code I
find it works correctly. But if I pull it out to test the individual
function it doesn't look good. I think you are right the best practice is
to return the slice.
For the connInfo struct comparison I learned that comparing
Wow this has everything for a crawler plus many more. Is it good to put the
code into so many files? I thought go program is simple enough to put most
code into one file. But I think if code reuse is the main concern maybe
this is good.
On Monday, September 25, 2017 at 10:44:45 PM UTC+8, Tim T
ocesses that read WORK, fetch the url, do whatever
>> it it that you need to do, and for urls found there, writes them to PENDING
>>
>> this is enough. now as written you have the challenge to know when the
>> workers are done and pending is empty. that's when you exi
Hi I am in a process of rewriting a realtime game server from Node.js to
Golang. It's two to three thousand lines of code in Node.js. But I have no
previous Golang experience so it's hard to measure the workload. Do you
think it is better for me to do some other bigger projects before I start
r
I'm pretty new to golang and struggling a bit with converting flat database
results into a nested JSON object.
As an example... I have
type item struct {
raceID string
racename string
name string
votesint32
}
type race struct {
raceID string
racename string
racers
}
type racers
e outgoing connection.
RedisWriteHandler will stall if either one of these outgoing requests hangs.
While timeouts will not fix your problem, they will allow you to further
diagnose the problem.
- Aaron
On Friday, May 4, 2018 at 7:24:56 AM UTC-7, s...@whites.team wrote:
>
> Hi all,
&
Question:
Where
In function mapiternext
Why
We won't update the map during the traversal process. So why use mapaccessK
to find the k & v again ?
if (b.tophash[offi] != evacuatedX && b.tophash[offi] != evacuatedY) ||
!(t.reflexivekey() || alg.equal(k, k)) {
// This is the golden data, we can retu
.
Aaron
On 8/30/16, seb.st...@gmail.com wrote:
> In my application I select on a ticker channel, but sometimes need to have
> the waiting time vary a bit. For not so frequent changes I could make a new
>
> ticker everytime, but I have the feeling this is not the best solution
It's also probably worth noting that 'go get' isn't really a package manager in
the way that yarn and npm are. Each of those tools, and their go equivalents
[1] have somewhat more sophisticated functionality related actually managing
the packages, controlling their versions, resolving conflicts,
ntrol this
setting...although I guess most of them don't really compile down to a
native binary in the end.
-Aaron
On Monday, April 30, 2012 at 10:21:06 PM UTC-4, Russ Cox wrote:
>
> On Mon, Apr 30, 2012 at 21:51, David Leimbach > wrote:
> > I was just playing with
27;re calling C from Go. There must be other rare, obscure ways to exploit
overflows in code generated from Go, no?
On Thursday, December 22, 2016 at 5:31:14 PM UTC-5, Ian Lance Taylor wrote:
>
> On Thu, Dec 22, 2016 at 2:09 PM, Aaron Wood > wrote:
> >
> > This is a rather
Hi all,
I'm seeing a very strange issue that I'm not quite sure how to fix:
https://github.com/mesos/mesos-go/blob/next/backoff/backoff.go#L25
https://github.com/mesos/mesos-go/blob/next/backoff/backoff.go#L80
This causes a data race, and of course we only see it when running on a
beefy server
t;
>
> On Thursday, February 2, 2017 at 12:43:09 PM UTC-5, Aaron Wood wrote:
>>
>> Hi all,
>>
>> I'm seeing a very strange issue that I'm not quite sure how to fix:
>>
>> https://github.com/mesos/mesos-go/blob/next/backoff/backoff.go#L25
>>
TypeOf(<-tokens) != reflect.TypeOf(*new(struct{})) {
t.Fatal("Token is of the wrong type")
}
}
On Thursday, February 2, 2017 at 1:43:12 PM UTC-5, James Bardin wrote:
>
> Can you post the actual output from the race detector?
>
>
> On Thursday, February 2, 2017 at 12:43:0
I can't unfortunately since it's private right now :( I can show you the
entire back off source file here if you'd like, I just can't link you to
anything right now.
On Thursday, February 2, 2017 at 2:29:37 PM UTC-5, James Bardin wrote:
>
> Can you point to the actual source you're using? The fi
auses the race detector to indicate the wrong lines in the source file.
>
> On Thu, Feb 2, 2017 at 11:33 AM, Aaron Wood > wrote:
>
>> I can't unfortunately since it's private right now :( I can show you the
>> entire back off source file here if you'd like, I ju
UTC-5, Aaron Wood wrote:
>
> Hi all,
>
> I'm seeing a very strange issue that I'm not quite sure how to fix:
>
> https://github.com/mesos/mesos-go/blob/next/backoff/backoff.go#L25
> https://github.com/mesos/mesos-go/blob/next/backoff/backoff.go#L80
>
> This causes
Oh man, it looks like you can't use covermode=count with race
detection? https://github.com/golang/go/issues/12118
On Thursday, February 2, 2017 at 12:43:09 PM UTC-5, Aaron Wood wrote:
>
> Hi all,
>
> I'm seeing a very strange issue that I'm not quite sure how to
Sorry guys. False alarm. The real issue was that we needed to use
covermode=atomic instead of covermode=count in our CI.
On Thursday, February 2, 2017 at 12:43:09 PM UTC-5, Aaron Wood wrote:
>
> Hi all,
>
> I'm seeing a very strange issue that I'm not quite sure
Thanks! I'm sure I'll never forget this experience :)
--
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,
I'm wondering why it's not possible to do something like
this https://play.golang.org/p/UaRLUvhkgz
If a type implements an interface then why can that type not be returned
with the method specifying the return type as the interface that it
implements?
--
You received this message because you
hane wrote:
>
> Seems to work fine to me: https://play.golang.org/p/6DmDKQLrzd.
>
> In your snippet, the concrete type doesn't implement the interface,
> however. What was the error you got when trying to do apply this to more
> complicated code.
>
> Chris
>
>
7;m really loving this!
Thanks for all the hard work!
Aaron
--
This message was sent from a mobile device
--
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 a
ion is
doing if you squint a bit. :)
Anyway, just my $0.02. Thanks again for all the hard work on this.
Aaron
On 6/16/20, Ian Lance Taylor wrote:
> On Tue, Jun 16, 2020 at 8:31 PM Aaron Cannon
> wrote:
>>
>> I, like many others, am not fond of all the parenthesis, particularly
so I don't
think I can do
// #cgo LDFLAGS: -lmy{VAR_NAME}lib
And I don't have the option of setting the library name to be constant. Is
there a way I can link with cgo here?
Thanks,
Aaron
--
You received this message because you are subscribed to the Google Groups
"go
Lance Taylor wrote:
> On Wed, Apr 28, 2021 at 8:41 AM Aaron Epstein wrote:
> >
> > I have a C library that I am linking with from Go whose name is known at
> build-time, and is not a constant I can write in a comment like
> > // #cgo LDFLAGS: -lmylib
> >
> > The
: warning: ignoring #pragma GCC diagnostic
_cgo_export.c:8: warning: ignoring #pragma GCC diagnostic
CGO_ENABLED=1 is set as well. This is using go 1.13. Any ideas?
Thanks,
Aaron
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubs
gcc
Is there a way to see which version go is picking up? I have both 4.9.4 and
4.1.2. I suspect it is picking up 4.1.2 and this is the cause, but is there
a way to tell?
On Thursday, May 20, 2021 at 9:36:57 AM UTC-4 Ian Lance Taylor wrote:
> On Thu, May 20, 2021, 4:47 AM Aaron Epstein wr
Removing gcc 4.1.2 from PATH so it picked up 4.9.4 which resolved this
issue.
Still would be good to know if it is possible to know which gcc go is
using...
On Thursday, May 20, 2021 at 9:46:34 AM UTC-4 Aaron Epstein wrote:
> gcc
>
> Is there a way to see which version go is pick
To this day the most prevalent, evasive and destructive malware is developed
in C/C++... So may as well ban those languages too!!
Seriously, if your answer to 'stopping malware written in Go' is to ban all
applications written in Go, your security team needs some more training budget
or you
Another option for this is if your function is always called after the call to
the external library, you can change your function signature to match the
return value of the external library.
Its quite common to see something like this:
`
func A() (int, error) {}
func UseA(a int, err error) (in
In general, no. Each time you pass around a []byte you are actually passing
around a copy of a pointer to the slice. Modifications will affect the
underlying slice.
You can use arrays instead, which are always PBV.
Take care though, if you try to pass an array to a function accepting a
slice vi
Hi all
Anyone know of a JSON package (or other solution) which is case-sensitive
when decoding - and is also mature, simple, and parses into a struct?
I've looked at a few open-source packages, but the ones I've found seem to
be focused on performance, or allowing you to access the JSON in diffe
Thank you! You are correct. That was exactly my problem. Adding the
equals sign (=) solved it.
I guess I need to be more aware that sometimes an equals statement is
required on a 'var' line and other times it is not. (perhaps only when it
has a literal)
Thanks again!
On Thu, Jun 6, 2019 at 1
site literal expression. It could also be written as
>
> var bar []struct{a, b, c string} = []struct{a, b, c string} {
> { "really", "long", "row"},
> { "many", "many", "rows"},
> ...
> }
>
> On Thu, Jun 6, 2019 at 2
On Fri, Dec 2, 2016 at 7:32 PM, wrote:
> Hello Aaron, have you figure it out yet?
Sorry, I haven't done anything further here.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiv
I seem to be regularly working with maps of stringsets and I have
found myself writing the same pattern over and over and I ended up
having my own utility function. More importantly the syntax seems
clunky when a key doesn't exist in the map. Is there a better way (go
idiomatically way) to write
lar to those provided by golang.org/x/exp/maps and for those helpers to
work on pointers to types whose underlying type is gomap.Map.
Thanks,
Aaron
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop
rking how I want. So, what I can
do instead is define an interface that includes the methods that Foo
provides and use that as my constraint. https://go.dev/play/p/BwEb8Lm4pb6
Aaron
On Friday, October 21, 2022 at 10:44:57 PM UTC-7 axel.wa...@googlemail.com
wrote:
> Actually (maybe I should sto
I would recommend reading up on how to implement Go interfaces.
The only requirement required to satisfy the io.Writer interface is a
method Write([]byte)(int,error). If this method is present, Go can then
interpret your struct as a io.Writer.
By itself, io.Writer provides no functionality only
42 matches
Mail list logo