[go-nuts] Re: [ANNOUNCE] for gopher audiophiles.

2018-08-07 Thread Jimmy Tang
this looks interesting, I've been using various go sox bindings for doing various sound processing (for machine learning) will your toolkit aim to provide similar functionality but in native go? On Wednesday, 8 August 2018 04:33:48 UTC+1, Scott Cotton wrote: > > Hello all, > > I am pleased to an

[go-nuts] Re: Custom types for use with range (Go 2)

2018-08-07 Thread Christophe Meessen
If considering user defined Ranger interface, I would strongly suggest to look at D's equivalent. The interface is simple and there are many use of it. It is trivial to develop a reverse range or ranges that traverse data structures (e.g. binary trees) in different ways (once you have generics).

[go-nuts] go go1.10.3 fatal error: runtime: netpoll failed

2018-08-07 Thread Dave Cheney
As Ian explained on the GitHub issue you raised, RHEL5 is not supported by any version of Go - the 2.6.18 kernel is below our minimum requirements. Dave -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop re

Re: [go-nuts] How to signal(sigint) blocking goroutine

2018-08-07 Thread Ian Lance Taylor
On Tue, Aug 7, 2018 at 7:02 PM, wrote: > > https://play.golang.org/p/d5n9bYmya3r > > I'm new to the go language and trying to figure out how to sigint a blocking > goroutine. in the playground code I included an infinite for loop to > simulate the blocking. In my real world use the for block wou

[go-nuts] How to signal(sigint) blocking goroutine

2018-08-07 Thread nateandjenn
https://play.golang.org/p/d5n9bYmya3r I'm new to the go language and trying to figure out how to sigint a blocking goroutine. in the playground code I included an infinite for loop to simulate the blocking. In my real world use the for block would be a long running file save from an external d

[go-nuts] go go1.10.3 fatal error: runtime: netpoll failed

2018-08-07 Thread neo . ajax1991
[root@YF-DGE2 update]# ./watchping watch agent watchping: comments to xxx *The occasional mistake* [root@YF-DGE2 update]# ./watchping runtime: epollwait on fd 4 failed with 38 fatal error: runtime: netpoll failed runtime stack: runtime.throw(0xc63ded, 0x17) /usr/local/go_1.10/src/run

Re: [go-nuts] buffer.WriteString Error case

2018-08-07 Thread Sam Whited
On Tue, Aug 7, 2018, at 19:43, Ian Lance Taylor wrote: > So that it implements the (unexported) interface io.stringWriter. I've wondered about this for a while; I find myself creating a StringWriter interface frequently in various projects. With all the other great standard interfaces in the io

[go-nuts] [ANNOUNCE] for gopher audiophiles.

2018-08-07 Thread Scott Cotton
Hello all, I am pleased to announce a new project dedicated to rendering "awesome" sound processing and i/o in Go, ZikiChombo , The project is in alpha, and this announcement is mostly geared toward people potentially interested in helping. (you may want to check out t

[go-nuts] buffer.WriteString Error case

2018-08-07 Thread Dave Cheney
So that it can be used interchangeably with *bufio.Writer. -- 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 opt

Re: [go-nuts] buffer.WriteString Error case

2018-08-07 Thread Ian Lance Taylor
On Tue, Aug 7, 2018 at 10:17 AM, Rohit Jain wrote: > > I Just happened to look at below comment on *WriteString* > > ```// WriteString appends the contents of s to the buffer, growing the buffer > as > // needed. The return value n is the length of s; err is always nil. If the > // buffer becomes

[go-nuts] Re: How to update packages without duplicating distro packages

2018-08-07 Thread Space A.
Hi, I'm using this approach as workaround: cd $GOPATH/src && for dir in github.com/*/* golang.org/*/* gopkg.in/*; do go get -u $dir; done понедельник, 6 августа 2018 г., 7:12:58 UTC+3 пользователь Kevin Locke написал: > > Hello, > > Is there a way to update packages installed using `go get`

[go-nuts] Re: How to update packages without duplicating distro packages

2018-08-07 Thread Space A.
Sorry, this one has correct paths: cd $GOPATH/src && for dir in github.com/*/* golang.org/*/* gopkg.in/*; do echo "go get -u $dir"; done среда, 8 августа 2018 г., 1:30:53 UTC+3 пользователь Space A. написал: > > Hi, > > I'm using this approach as workaround: > > for dir in src/github.com/*/*

[go-nuts] Point by Reference in Golang

2018-08-07 Thread paulhay88
Hey guys, just looking for some direction on some good reference material on GO's point by reference Just learning and looking to read up some more on a few things i struggle with, any help would be appreciated Thank you -- You received this message because you are subscribed to the Google Gr

[go-nuts] Re: How to update packages without duplicating distro packages

2018-08-07 Thread Space A.
Hi, I'm using this approach as workaround: for dir in src/github.com/*/* src/golang.org/*/* src/gopkg.in/*; do go get -u $dir; done понедельник, 6 августа 2018 г., 7:12:58 UTC+3 пользователь Kevin Locke написал: > > Hello, > > Is there a way to update packages installed using `go get` witho

[go-nuts] Re: Custom types for use with range (Go 2)

2018-08-07 Thread Matt Sherman
Sorry for late reply: yes, it’s sugar, and a first implementation might be to have the compiler simply rewrite it like a macro, as in your example. And I realize that my example was more verbose than need be. We don’t call an iterator on arrays, maps, etc, so my example should have been: for t

Re: [go-nuts] Re: looking for a flexible file path resolver

2018-08-07 Thread Marvin Renich
* DrGo [180806 18:37]: > There are situations where you need to check (and report back to the user) > for file existence no matter how you do that (using Stat or by attempting > to open or create it). I agree completely. However, doesn't os.Stat do what you want here simply and portably? If

[go-nuts] wireguardctrl: enables control of WireGuard devices on multiple platforms

2018-08-07 Thread Matt Layher
Hi all, I'm here to share a project I've been working on: https://github.com/mdlayher/wireguardctrl I'm not quite finished with this package yet (see issues), but now that I've got both the kernel and userspace APIs working, I figured it was time to share it to a more broad audience. For those

[go-nuts] buffer.WriteString Error case

2018-08-07 Thread Rohit Jain
I Just happened to look at below comment on *WriteString* ```// WriteString appends the contents of s to the buffer, growing the buffer as // needed. The return value n is the length of s; err is always nil. If the // buffer becomes too large, WriteString will panic with ErrTooLarge.``` >`err is

[go-nuts] Re: "declared local variable must be used once", is it enforced by Go spec? or just a behavior of gc?

2018-08-07 Thread kristijankantoci
Inside of [] cyles through. Between brackets. -- 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 ht

[go-nuts] Re: "declared local variable must be used once", is it enforced by Go spec? or just a behavior of gc?

2018-08-07 Thread kristijankantoci
! returns 1; . returns 0; Op zaterdag 28 juli 2018 15:48:39 UTC+2 schreef T L: > > . > -- 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...@go

[go-nuts] Re: go/format ouputs spurious newlines

2018-08-07 Thread naha
I think my problem might be related to the logic around line 982 of https://golang.org/src/go/printer/printer.go. I don't yet understand the distinction between the impliedSemi local variable and the impliedSemi field of printer. How would I fetch and build the go/printer code and install it i

Re: [go-nuts] How to refactor out this function

2018-08-07 Thread Tong Sun
Thanks a lot Sam. A follow up question, what's the Go way of naming such functions? Java would name it like "somethingFactory", C# would name it like "GetHelloFunction". what's the typical Go naming, for a factory function that generates Hello handling function? thx On Tuesday, August 7,

Re: [go-nuts] CGO - convert a c.char array to string

2018-08-07 Thread Ian Lance Taylor
On Mon, Aug 6, 2018 at 11:34 PM, nicolas_boiteux via golang-nuts wrote: > > yes i used the code from this page: > > func Float64bits(f float64) uint64 { > return *(*uint64)(unsafe.Pointer(&f)) > } > > adapted to my use case > > *(*int)(unsafe.Pointer(limit) As the docs say, that is only permissib

[go-nuts] Re: Checking if two map variables refer to the same map

2018-08-07 Thread mike
Sorry for bumping a very old thread, but I absolutely disagree with the people stating that this problem is contrived, and I got here from a Google search, so this might be relevant for some people. A very real use-case for reference-comparing maps is when testing .Clone() methods. You want to

[go-nuts] Re: How should I avoid - literal copies lock value from

2018-08-07 Thread Dave Cheney
Pass a pointer, *Set into your Diff method. -- 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 htt

Re: [go-nuts] CGO-How to access C struct pointer correctly

2018-08-07 Thread Jan Mercl
On Tue, Aug 7, 2018 at 2:42 PM 陈一剑 wrote: > I want to print 333,but the result is strange. The answer is provided by the compiler itself: jnml@r550:~/src/tmp> cat main.go package main import ( "fmt" /* struct Test{ int ID; }; struct Test * test(){ struct Test test; test

[go-nuts] Re: How should I avoid - literal copies lock value from

2018-08-07 Thread Kasun Vithanage
Error is gone when used mux *sync.Mutex On Tuesday, August 7, 2018 at 6:12:26 PM UTC+5:30, Kasun Vithanage wrote: > > I'm implementing some thread safe data structures > > type Set struct { >m map[string]int >mux sync.Mutex > } > > > func New() *Set { >return &Set{m: make(map[str

Re: [go-nuts] archive/tar and @LongLink

2018-08-07 Thread clewis . cl136
How do I delete these files and delete off my SD card?? -- 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 option

[go-nuts] How should I avoid - literal copies lock value from

2018-08-07 Thread Kasun Vithanage
I'm implementing some thread safe data structures type Set struct { m map[string]int mux sync.Mutex } func New() *Set { return &Set{m: make(map[string]int)} } In my Diff function i need to pass an array of sets to do a diff on another set func (set *Set) DiffS(sets []Set) *Set {

[go-nuts] CGO-How to access C struct pointer correctly

2018-08-07 Thread 陈一剑
package main import ( "fmt" /* struct Test{ int ID; }; struct Test * test(){ struct Test test; test.ID=333; return &test; }; */ "C" ) type c struct { ID int } type Test struct { a string b string } func

Re: [go-nuts] How to refactor out this function

2018-08-07 Thread Sam Whited
You'd want to use a function that returns another function and takes the dependencies as arguments, something like this: func Sender(b *B) func(m *tb.Message) { return func(m *tb.Message) { b.Send(m.Sender, "hello world") } } s := Sender(b) b.Handle("/hello", s) b.Handle("/hi", s

[go-nuts] How to refactor out this function

2018-08-07 Thread Tong Sun
Hi, Consider this function: b.Handle("/hello", func(m *tb.Message) { b.Send(m.Sender, "hello world") }) I tried to refactor the above function to func sayHi(m *tb.Message) {...}, so that I can give an alias to the above /hello command (say to define a /hi com