Please raise an issue https://golang.org/issue/new
On Wednesday, 18 October 2017 16:06:28 UTC+11, bronze man wrote:
>
> I already found this bug yesterday.
> I am thinking why not golang team just fix this bug by change code?
> It looks easier to fix this bug then to document this bug.
>
> On Tue
I already found this bug yesterday.
I am thinking why not golang team just fix this bug by change code?
It looks easier to fix this bug then to document this bug.
On Tuesday, October 17, 2017 at 11:59:42 AM UTC+8, Ian Lance Taylor wrote:
>
> On Mon, Oct 16, 2017 at 8:17 PM, bronze man > wrote:
Following is a dangerous error-prone technique. If you use it in you program,
most likely you have a hidden bug, that will appear in high concurrency
situation.
```
func wait(c chan T) T {
v := <-c
c <- v;
return v;
}
```
I had proposal for future primitive: http
Personally it's not a verbosity issue but a readability issue 99% of the
time.
if go fmt would just keep the whole if statement on a single line it would
already alleviate some of the pain of having to read
a codebase ridden with error handling code.
if foo,err = DoIO();err!=nil{return err
There are lots of similar proposals in the issue tracker.
Of those, https://golang.org/issue/21161 seems to have the most traffic.
On Tuesday, October 17, 2017 at 5:09:33 PM UTC-4, Nicolas Grilly wrote:
>
> I just read about Zig, a new programming language designed to replace C.
>
> The error hand
On Tuesday, October 17, 2017 at 4:52:55 PM UTC-4, Nicolas Grilly wrote:
>
> Hello,
>
> I just read about the concept of compile-time parameters in Zig (a new
> programming language designed to replace C):
>
>
> http://andrewkelley.me/post/zig-programming-language-blurs-line-compile-time-run-time.h
On Tue, Oct 17, 2017 at 5:03 PM, wrote:
>
> I was wondering if the code ever panics and we have a if recover :=
> recover(); recover != nil {
>
> in a defer func and we are using sync.RWMutexes which do not have a defer to
> unlock for example.
>
> What kinds of things can happen if the code unex
Hi there,
I was wondering if the code ever panics and we have a if recover := recover();
recover != nil {
in a defer func and we are using sync.RWMutexes which do not have a defer
to unlock for example.
What kinds of things can happen if the code unexpectedly panics when we are
in a Lock() in
Hi, friends,
I am trying to create a very simple network sniffer. Initially I
implemented it with libpcap, but I got not only performance issue, but also
timing issue. Now I am trying to replace libpcap with afpacket. However, I
am not able to get any packet from the GRE tunneled terminated a
On Tuesday, 17 October 2017 14:59:30 UTC+11, Nate Finch wrote:
>
> So I figured out I was looking for the error in the wrong place. The
> place it was failing was in go/types when it tries to parse the files,
> using the go/build.Default context. Which is created here:
> https://github.com/g
> Depends on what your profiling is telling you.
The trouble is -- I have no idea what is the impact of small allocations.
I've managed to eliminate most useless large allocations (the amount of
data consed used to be twice the amount of data processed, it's now on
the order of 103%), which has ha
On Tue, Oct 17, 2017 at 2:43 PM, wrote:
>
> I was wondering how to run tests and benchmarks of the Go standard library
> such as this one:
> https://go-review.googlesource.com/c/go/+/44730/4/src/crypto/tls/handshake_server_test.go#1056
>
> $ pwd
> $GOPATH/src/github.com/golang/go/src/crypto/tls
>
> A method value, on the other hand, will allocate memory in some cases,
> as it may need to hold a copy of the value whose method will be
> invoked.
Even if the method takes a pointer receiver?
-- Juliusz
--
You received this message because you are subscribed to the Google Groups
"golang-nut
I was wondering how to run tests and benchmarks of the Go standard library
such as this one:
https://go-review.googlesource.com/c/go/+/44730/4/src/crypto/tls/handshake_server_test.go#1056
$ pwd
$GOPATH/src/github.com/golang/go/src/crypto/tls
$ git rev-parse HEAD
5f740d6875ab6961381f2f4614b21ff6d
> The answer depends on whether you have just one value or many. For a single
> value (sometimes known as a "future"), I tend to pair a chan of struct{}
> with a value to be set. To make the value available, set it, then close the
> channel. Readers wait on the channel, then read the value.
That's
I just read about Zig, a new programming language designed to replace C.
The error handling philosophy is very similar to Go: control flow in
general and error handling in particular is explicit. Zig has even a defer
statement inspired by Go ;-)
I noticed that Zig provides a %% operator and %re
Yes.
--
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.
Hello,
I just read about the concept of compile-time parameters in Zig (a new
programming language designed to replace C):
http://andrewkelley.me/post/zig-programming-language-blurs-line-compile-time-run-time.html
Could it be a way to provide generic functions and data structures in Go?
I note
I had originally written seshcookie pre-Go1. I've recently updated the
library to work with Contexts, use AES-GCM for simpler authenticated
encryption, and improved the tests.
https://github.com/bpowers/seshcookie
Let me know if you see anything you think can be improved or removed!
yours,
Bobb
On Tue, Oct 17, 2017 at 11:50 AM, Juliusz Chroboczek wrote:
>
> I was about to do something like that:
>
> var p *P
> ...
> otherpackage.f(func(data []byte) {
> a := p.x + p.y * 42 + p.someothercomplicatedstuff
> p.g(data, a)
> }
>
> (Yeah, I know. I dislike call
This is 1.9.1 and I had not thought of switching to http2 although do need to
maintain the 1.1 for older clients.
The closing of the body could explain it though which I thought was automatic
on a return from the handlers? Do I need to explicitly call that in the
handlers??
--
You received t
I was about to do something like that:
var p *P
...
otherpackage.f(func(data []byte) {
a := p.x + p.y * 42 + p.someothercomplicatedstuff
p.g(data, a)
}
(Yeah, I know. I dislike callbacks too, but I'm pretty much stuck in
this particular case since Go doesn't do
Have you looked at the dep tool (github.com/golang/dep) ?
On 17 Oct 2017 13:42, "Conrad Wood" wrote:
> Hi,
>
> We're considering Go for new services in our software architecture.
> Generally it seems like a good fit. There are a few things I'm not sure
> about though, so I wonder what others do:
What version of Go are you using? Have you tried HTTP/2?
The only thing that jumps out at me is that r.Body() is never closed.
--
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
I have the following code which was working fine in test but in live I am
getting 500 errors reported to the clients with multiple lines of
2017/10/17 15:44:52 http: Accept error: accept tcp [::]:9090: accept4: too
many open files; retrying in 1s
2017/10/17 15:44:53 http: Accept error: accept t
>
>
> Having tried using things like gleam/glow (see
> https://github.com/chrislusf/gleam) and dask (which has similar ideas but
> written in python) it sounds like a FIFO work stealing type scheduler
> wouldn't be a bad idea. In particular dask's approach is quite nicely put
> together. Thoug
Here's a case that comes up for me:
type table map[string]map[string]string
func (t table) add(x, y, z string) {
if t[x] == nil {
t[x] = make(map[string]string)
}
t[x][y] = z
}
func (t table) get(x, y string) string {
return t[x][y]
}
The fact that t[x] can be indexed even if it has
just a heads up regarding Ubuntu Bash Shell on Windows10: if you open the
Ubuntu Bash Shell and type the command: "*lsb_release -a" *you might
discover it is running Ubuntu 14.04 you might want to run an upgrade to
Ubuntu 16.04 which is now available. See the following for installation
details
If you have serious performance needs, then something like the "Disruptor"
pattern is useful. There are ports of that from Java to Go out there, but I
don't know how stable or useful they are.
The Disruptor pattern is to keep a circular ring-buffer of elements. The
writer and each reader keeps tra
Hi Michał,
Do the second and third line(s) depend on the success of the previous
one(s)? If so, a Bash script seems a good option as it allows you to stop
the whole process if one step fails.
If you are not a fan of Bash or of makefiles, or if you don't want to
restrict yourself to systems tha
Maybe you can try this https://github.com/minio/sha256-simd
在 2017年10月17日星期二 UTC+8下午4:13:41,Christian LeMoussel写道:
>
> I need to calculate 10 millions of sha256 checksums,
>
> Actually I do this :
>
> var bl int
> var pnb = make([]byte, 10)
> var hash = [32]byte
> var sha256Hash string
> var ste
Hi,
We're considering Go for new services in our software architecture.
Generally it seems like a good fit. There are a few things I'm not sure
about though, so I wonder what others do:
1. How does one ensure repeatable builds? (go get obviously pulls from the
internet by default.to get repeat
OK, I'm new in GO. As you indicate I will profiling by writing a standard
testing.B benchmark. Thanks
--
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
There are syntax errors in your code.
On Tuesday, 17 October 2017 09:13:41 UTC+1, Christian LeMoussel wrote:
>
> I need to calculate 10 millions of sha256 checksums,
>
> Actually I do this :
>
> var bl int
> var pnb = make([]byte, 10)
> var hash = [32]byte
> var sha256Hash string
> var steps = 1
yes
On Tue, Oct 17, 2017 at 3:47 AM, Sebastien Binet wrote:
> hi,
>
> (thanks for having a look at this)
>
> On Tue, Oct 17, 2017 at 6:01 AM, mura wrote:
>
>> Hi,
>>
>> A sequential read with `dd if=f64s.root of=/dev/null bs=32` takes around
>> 8.5 secs (10.4 secs using read-data.go) on my mach
hi,
(thanks for having a look at this)
On Tue, Oct 17, 2017 at 6:01 AM, mura wrote:
> Hi,
>
> A sequential read with `dd if=f64s.root of=/dev/null bs=32` takes around
> 8.5 secs (10.4 secs using read-data.go) on my machine. It would even take
> up to 55 secs when bs = 1.
> Also I observe that t
that's an great article thank you!
On Sunday, October 15, 2017 at 6:51:03 PM UTC-7, dja...@gmail.com wrote:
>
> This post might help:
>
> https://rogpeppe.wordpress.com/2009/12/01/concurrent-idioms-1-broadcasting-values-in-go-with-linked-channels/
>
> Djadala
>
> On Sunday, October 15, 2017 at 11
The answer to your question is to profile your function. You can do this by
writing a standard testing.B benchmark which will give you access to Go’s
profiling tools more or less for free.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To uns
I need to calculate 10 millions of sha256 checksums,
Actually I do this :
var bl int
var pnb = make([]byte, 10)
var hash = [32]byte
var sha256Hash string
var steps = 1000
startBench := time.Now()
for i := 0; i < steps; i++ {
bl = 0
bl += copy(pnb[bl:], "TEST")
bl += copy(nonce
39 matches
Mail list logo