Re: [go-nuts] Writing safe CGO calls and callbacks and how that affects system threads

2017-02-13 Thread Luka Napotnik
Ok, thanks for the clarification. On Tue, Feb 14, 2017 at 12:53 AM Ian Lance Taylor wrote: > On Mon, Feb 13, 2017 at 1:14 PM, wrote: > > On Monday, February 13, 2017 at 7:02:22 AM UTC+1, Luka Napotnik wrote: > >> > >> I forgot to mention that the main

Re: [go-nuts] Looking for free, part-time, remote internship.

2017-02-13 Thread Malhar Vora
Hi Bakul, Thanks for very good explanation. I agree with your idea of creating my own application using Go. Also that is totally correct that already created projects mostly have architecture in place and I need to work according to their practices. Regarding coding skills , I am carrying 3

Re: [go-nuts] Looking for free, part-time, remote internship.

2017-02-13 Thread Bakul Shah
Here’s a somewhat different POV. Hope it helps. If you decide to work on an existing project, often times as a newbie you’ll be asked to fix bugs or add a small feature, which may not always the most exciting thing to do + you may have to bootstrap on the code and learn a lot of other stuff

Re: [go-nuts] Re: Struggling with working directory

2017-02-13 Thread Diego Medina
> Not sure why its being difficult. knowing why I needed a GOPATH and what it was used for was probably the main issue I had when I started with Go too, some 3+ years ago, we'll help you get through it. Now, if you go back to the original instructions, https://golang.org/doc/install#install you

[go-nuts] xattrib on symlinks and holes in syscall support

2017-02-13 Thread 'simon place' via golang-nuts
i have been tidying up some xattrib (extended file attribute) code, and had what i thought was a cool idea. that idea used xattribs on symlinks. but when i tried this i found that syscall.Getxattr uses the sys call for following syslinks, (it wraps SYS_GETXATTR) and that the corresponding

Re: [go-nuts] Writing safe CGO calls and callbacks and how that affects system threads

2017-02-13 Thread Ian Lance Taylor
On Mon, Feb 13, 2017 at 1:14 PM, wrote: > On Monday, February 13, 2017 at 7:02:22 AM UTC+1, Luka Napotnik wrote: >> >> I forgot to mention that the main goroutine in the test program is locked >> to a thread as I call runtime.LockOSThread() in init() > > > The Go Spec says

Re: [go-nuts] efficiency of string <-> []byte conversion

2017-02-13 Thread Ian Lance Taylor
On Mon, Feb 13, 2017 at 12:31 PM, Alex Flint wrote: > > As of go1.8, do conversions between strings and byte slices always generate > a copy? Usually but not absolutely always. The gc compiler has an optimization for map lookups. For a map[string]T, when s is a []byte,

Re: [go-nuts] Writing safe CGO calls and callbacks and how that affects system threads

2017-02-13 Thread db047h
On Monday, February 13, 2017 at 7:02:22 AM UTC+1, Luka Napotnik wrote: > > I forgot to mention that the main goroutine in the test program is locked > to a thread as I call runtime.LockOSThread() in init() The Go Spec says "Package

Re: [go-nuts] Re: Struggling with working directory

2017-02-13 Thread Dave Cheney
Those instructions are wrong, I've written to the author and asked them to remove the incorrect information. Please follow the installation instructions on the golang.org website, they are well tested and known to work well. https://golang.org/doc/install On Tuesday, 14 February 2017 09:07:54

Re: [go-nuts] Re: efficiency of string <-> []byte conversion

2017-02-13 Thread Val
Right, most approaches don't cover all the cases (which would be impossible, but we can still try to tend to). In my porous memories, some cases were not exactly about immutability, rather about escape analysis : "If I just built []byte x, and I return string(x), and x doesn't escape, then the

Re: [go-nuts] Re: efficiency of string <-> []byte conversion

2017-02-13 Thread Alex Flint
Thanks Val. I actually did a search before posting this and turned up many of those same links, but it seems like they're all just reasoning from the immutability of strings, which I don't think is quite sufficient to answer the question in all cases. Anyway, thanks for your help and I think for

[go-nuts] Re: efficiency of string <-> []byte conversion

2017-02-13 Thread Val
Hello Alex, good point. I remember this has indeed come up in discussions in this forum. Searching "byte slice string copy" gave (among others) [1] [2] [3] [4] [5] [6] [7]. All of these look related to the suggested optimization "don't allocate for a []byte to string, or string to []byte,

Re: [go-nuts] Re: Struggling with working directory

2017-02-13 Thread Sayth Renshaw
That's the one i used first but got errors that it couldn't find GOPATH even though i installed it to the suggested default location. So when that didn't work i delete the go directory and the details from .profile and then followed ://

[go-nuts] Delve: Any way to get the "listing" of code when using "dlv attach " ?

2017-02-13 Thread Lax Clarke
Hi, Is there any way to get the listing of code (i.e., "list" ) after doing dlv attach ? That is, I want to build my golang binary such that attaching to it later gives me the line by line listing. Thanks -- You received this message because you are subscribed to the Google Groups

[go-nuts] efficiency of string <-> []byte conversion

2017-02-13 Thread Alex Flint
As of go1.8, do conversions between strings and byte slices always generate a copy? I understand the immutability guarantees in the language spec, but I'm interested in this from an efficiency standpoint. I can imagine a compiler that analyzes whether a byte slice created from such a

[go-nuts] Re: Reaching infinity

2017-02-13 Thread Nikita Loskutov
Hello again! I thought about it today and I think I found solution for 4th infinity. Check out here https://gist.github.com/cnaize/c106969508bdd898cc3b5026c110ed65 Any ideas how to increase to 5? четверг, 17 ноября 2016 г., 1:58:04 UTC+4 пользователь Nikita Loskutov написал: > > Hello! > >

Re: [go-nuts] two questions

2017-02-13 Thread Will Donnelly
On Monday, February 13, 2017 at 10:35:39 AM UTC-8, Simon Perfer wrote: > > Thank you Zlatko. > > > I actually have no idea how to call init_module() from my Go program. > Happy to do the legwork in figuring this out, but not even sure where to > start. > Is there something I should Google to

Re: [go-nuts] two questions

2017-02-13 Thread Simon Perfer
Thank you Zlatko. I actually have no idea how to call init_module() from my Go program. Happy to do the legwork in figuring this out, but not even sure where to start. Is there something I should Google to get my search started? What are the keywords I should look up to begin this process?

Re: [go-nuts] two questions

2017-02-13 Thread Zlatko Čalušić
On 13.02.2017 17:50, Simon Perfer wrote: I've been working on a pet science project: building an initramfs with only one file. Specifically, an executable written in Go. The only thing I can't figure out is how to do a "modprobe" in Go without actually having the modprobe utility. Is there

[go-nuts] two questions

2017-02-13 Thread Simon Perfer
I've been working on a pet science project: building an initramfs with only one file. Specifically, an executable written in Go. The only thing I can't figure out is how to do a "modprobe" in Go without actually having the modprobe utility. Is there a libkmod library available? If not, how

Re: [go-nuts] Looking for free, part-time, remote internship.

2017-02-13 Thread Malhar Vora
Hi Jacob, Thanks for reply. I'll surely check links you have provided. I agree with your suggestion regarding famous hot repos trending on Github. I'll check them too. Thanks, Regds, *Malhar Vora* http://about.me/malhar.vora On Mon, Feb 13, 2017 at 12:23 PM, Jakob Borg

[go-nuts] Writing google cloud functions using go

2017-02-13 Thread martin8900
Google cloud functions will soon leave alpha and enter beta (I have heard). https://cloud.google.com/functions/ The issue in my mind is lack of golang support (you basically write node.js express handlers for http functions). So I tried fiddling with gopherjs to create a framework

Re: [go-nuts] Handshake failed when using builtin TLS package: no cipher suite supported by both client and server

2017-02-13 Thread Alexandr Emelin
For history: we've made it work with Let's Encrypt issued certificates too: adding *ForceRSA: true* to autocert.Manager did the trick. четверг, 9 февраля 2017 г., 10:48:08 UTC+3 пользователь Alexandr Emelin написал: > > Just tried trial certificate from Comodo - it works! So the problem is in

Re: [go-nuts] [Proposal] Std Lib Logging Abstraction

2017-02-13 Thread Sotirios Mantziaris
i have already build such an abstraction myself (https://github.com/mantzas/adaptlog). the issue is not what i use but what all the packages out there use that i import. checkout the link mentioned by Dave Cheney On Monday, February 13, 2017 at 4:18:58 PM UTC+2, Tamás Gulácsi wrote: > > Use an

Re: [go-nuts] [Proposal] Std Lib Logging Abstraction

2017-02-13 Thread Tamás Gulácsi
Use an adapter which provides a writer to std lib's log, and pipes it through your chosen logging lib. Like go-kit/kit/log.StdAdapter. -- 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

Re: [go-nuts] Re: Struggling with working directory

2017-02-13 Thread Diego Medina
Can you include the link to the guide you followed to install Go? I always follow https://golang.org/doc/install#install which is, after downloading from the link on that page,: tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz and then adding: /usr/local/go/bin to the PATH And I have

Re: [go-nuts] The feature I want most, weak *

2017-02-13 Thread 'Axel Wagner' via golang-nuts
You can already achieve all of this without any kind of language change or cooperation from the go-team. Just add an annotation in a comment (e.g. "//foo:weak") on declarations of "weak" pointers and then have the tool look for them and do its analysis. On Mon, Feb 13, 2017 at 12:18 PM, Keynan

Re: [go-nuts] The feature I want most, weak *

2017-02-13 Thread Keynan Pratt
""" But once you start saying that we are going to reject storing nil in an interface value unless it is weak, then you are greatly complicating the type system. """ With regards to controls on nil this is a static analysis tool, not something I expect to be forced on anyone. As I understand it

[go-nuts] Re: Panic in go1.8rc3 using cgo to get binary data from database

2017-02-13 Thread Mark Crook
Thanks Daniel, that seems on the right track. The driver api itself is a C library, without source code. >From the driver api docs: /** * get_column() fills the supplied buffer with the value fetched for the * specified column. *For A_BINARY and A_STRING * data types,* * * value->buffer will

[go-nuts] Re: Struggling with working directory

2017-02-13 Thread Sayth Renshaw
On Sunday, 12 February 2017 04:16:15 UTC+11, Diego Medina wrote: > > Hi, > > you were very close, instead of > > go install github.com/mortalcatalyst/xml/xml.go > > do > > go install github.com/mortalcatalyst/xml > > > In go, you don't install the particular file, you install the program as a >

Re: [go-nuts] [Proposal] Std Lib Logging Abstraction

2017-02-13 Thread Sotirios Mantziaris
nice, i'll take a look On Monday, February 13, 2017 at 10:00:15 AM UTC+2, Dave Cheney wrote: > > There is an active discussion thread over on the development list -> > https://groups.google.com/forum/#!topic/golang-dev/F3l9Iz1JX4g -- You received this message because you are subscribed to the

Re: [go-nuts] [Proposal] Std Lib Logging Abstraction

2017-02-13 Thread Dave Cheney
There is an active discussion thread over on the development list -> https://groups.google.com/forum/#!topic/golang-dev/F3l9Iz1JX4g -- 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