Re: [go-nuts] Re: How has your company adopted Go ?

2016-12-20 Thread Henrik Johansson
For us it started with me rewriting a small service. It was done quickly and with great performance which led to curiosity from other developers which in turn led to a larger system of services being built in Go with great results. The initial usual fears about knowledge and "risks" was quickly all

[go-nuts] Re: How has your company adopted Go ?

2016-12-20 Thread 'Eric Johnson' via golang-nuts
On Monday, December 19, 2016 at 5:03:43 AM UTC-8, Tieson Molly wrote: > > What arguments or factors have contributed to your company adopting Go? > My company does enough different kinds of work that the question is too broad. To some, "adoption" might imply broad usage. In practice, usage evol

[go-nuts] Re: Testing "internal" packages?

2016-12-20 Thread Dave Cheney
Works for me, deadwood(~/src/github.com/davecheney/test) % go test -v ./... === RUN TestTest --- PASS: TestTest (0.00s) test_test.go:6: hello PASS ok github.com/davecheney/test 0.002s === RUN TestTest --- PASS: TestTest (0.00s) test_test.go:6: hello PASS ok gith

[go-nuts] Re: generic "CRUD" handlers

2016-12-20 Thread brian
take a look at goa and gorma: https://goa.design goa generates an API from your description DSL, and Gorma generates the data access layer. It uses gorm under the scenes so you'll have an easy route to migration. Brian On Tuesday, December 20, 2016 at 8:46:12 AM UTC-5, Thomas Bellembois wrote:

[go-nuts] Testing "internal" packages?

2016-12-20 Thread Vaidotas Sm
Hi, Why do "go test ./..." does not run any ./internal/... tests? This however works - "go test ./internal/...". What is the correct way to test all my code within project with single command? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] httputil.ReverseProxy + http.DefaultTransport.DialContext results in cancelled DNS requests

2016-12-20 Thread Matt Duch
I'm running into issues when using a ReverseProxy that sits in front of a service that serves static asset files (in this case, 100's in a few seconds). Occasionally (1 out ~500 files) will error out with: http: proxy error: dial tcp: lookup myapp.default.svc.cluster.local on 172.18.0.16:53: dia

[go-nuts] Re: install go compiler without sudo right

2016-12-20 Thread tungcheungleong
lscpu output: ``` Architecture: x86_64 CPU op-mode(s):32-bit, 64-bit Byte Order:Little Endian CPU(s):4 On-line CPU(s) list: 0-3 Thread(s) per core:1 Core(s) per socket:4 Socket(s): 1 NUMA node(s): 1 Vendor ID: G

[go-nuts] Re: install go compiler without sudo right

2016-12-20 Thread Dave Cheney
Yes, it is possible to install Go without sudo, here is the procedure % git clone https://go.googlesource.com/go go1.4 % cd go1.4/src % git checkout release-branch.go1.4 % ./make.bash % cd ~ % git clone https://go.googlesource.com/go % cd go/src % git checkout release-branch.go1.7 % ./make.bash

[go-nuts] Re: install go compiler without sudo right

2016-12-20 Thread tungcheungleong
The server is running CENTOS 7.1.15 , Xeon(R) lscpu result ``` Architecture: x86_64 CPU op-mode(s):32-bit, 64-bit Byte Order:Little Endian CPU(s):4 On-line CPU(s) list: 0-3 Thread(s) per core:1 Core(s) per socket:4 Socket(s): 1 NUM

[go-nuts] install go compiler without sudo right

2016-12-20 Thread tungcheungleong
I am trying to install go on my school server (without sudo right) I tried to install go1.4 then use it to install latest go. However, it failed when running all.bash for go1.4 Seems the system doesn't support (or no permission) hard link. I also tried to copy the files from my personal computer

[go-nuts] extracting transport failures in httputil.ReverseProxy

2016-12-20 Thread Alex Flint
Recently while using http.ReverseProxy I wanted to take a specific action if there was a TCP connection failure or other transport-level failure in ReverseProxy.ServerHTTP. However, ReverseProxy.ServeHTTP simply sets a BadGateway status code in this situation, which makes it impossible to different

Re: [go-nuts] Re: JSON smart parsing

2016-12-20 Thread C Banning
Seems to lack Encoding functionality. On Tuesday, December 20, 2016 at 1:39:14 PM UTC-7, ma...@influxdb.com wrote: > > https://github.com/json-iterator/go was recently trending on GitHub. > > I haven't used it personally but it sounds like it might fit your use case. > > On Tuesday, December 20, 2

Re: [go-nuts] Re: JSON smart parsing

2016-12-20 Thread mark
https://github.com/json-iterator/go was recently trending on GitHub. I haven't used it personally but it sounds like it might fit your use case. On Tuesday, December 20, 2016 at 11:43:53 AM UTC-8, Alexander Petrovsky wrote: > > Yep, I can, and I've already reads this article, but as I said, I ne

Re: [go-nuts] Re: JSON smart parsing

2016-12-20 Thread Alexander Petrovsky
Yep, I can, and I've already reads this article, but as I said, I need to unmarshal only part of the big body json with many dynamic fields. And I don't know and don't need all fields to unmarshal, only few. So, something like stream json parsers, which efficiently emit key and value, by example

Re: [go-nuts] Modern Garbage Collection Article

2016-12-20 Thread Jesper Louis Andersen
The key observation of a GC: It must match modern hardware, and it must match the programming language for which you write it for. Historically, Java allocated all objects on the heap. This adds GC pressure and in order to remove such GC pressure, you are soon reaching for a generational GC model.

Re: [go-nuts] Re: Go on AIX

2016-12-20 Thread scchang
Good to hear. I wasn't able to get very far with latest gcc on AIX 5.3. Since you have made good progress on AIX 6.1, I will not waste any more time on 5.3. That being said, I will try to bootstrap Go library to the latest. On Monday, 19 December 2016 08:10:56 UTC-8, matthieu.sar...@atos.net wr

[go-nuts] Please participate in the 2016 Go User Survey and Company Questionnaire

2016-12-20 Thread Steve Francia
Gophers, *We blogged this last week, but haven't started a thread here and want to make sure that we reach as broad a group of Gophers as possible as to provide accurate data. * The Go project wants to hear from you! If you haven't already, please help by participating in a survey and if appli

Re: [go-nuts] Re: JSON smart parsing

2016-12-20 Thread Shawn Milochik
You can write a custom JSON marshaller for your type. One example: http://choly.ca/post/go-json-marshalling/ https://golang.org/pkg/encoding/json/#Unmarshaler -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and

[go-nuts] Re: JSON smart parsing

2016-12-20 Thread Alexander Petrovsky
Hi! Thanks for the help, but I've try this, and unfortunately this is doesn't work for the big body dynamic json with more the 10 field -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails fro

[go-nuts] Re: JSON smart parsing

2016-12-20 Thread C Banning
Don't know how to make 'X' simple, but you can use a strategy like https://play.golang.org/p/1bdlbFWjwg which at least minimizes allocations by only Unmarshal'ing the k:v pairs of interest. On Tuesday, December 20, 2016 at 8:48:03 AM UTC-7, Alexander Petrovsky wrote: > > Hello! > > By example I

[go-nuts] Re: howto: compile template against well-known structure ?

2016-12-20 Thread mhhcbon
oh i see now. Indeed. Awesome and neat. Let sleep on it for now. > ... but, I think the implementation might be easier than statically compiling the standard templates. At least i can say two things by now, lots of fun, its a breaking go api change >.< On Tuesday, December 20, 2016 at 2:30:

[go-nuts] [ANN] sh 1.0 released, a shell parser and formatter

2016-12-20 Thread Daniel Martí
Hey all, I've been working on a shell language package for the past year. It supports both POSIX and Bash and includes a complete parser and printer. The API resembles go/*, so it can be used for similar purposes: https://godoc.org/github.com/mvdan/sh/syntax The first tool built around

Re: [go-nuts] How to cast type alias and interface to int

2016-12-20 Thread Christian von Kietzell
On Tue, Dec 20, 2016 at 12:45:33AM -0800, so.qu...@gmail.com wrote: > How would I cast type alias MyInt and interface Foo, to an int? > > https://play.golang.org/p/Sb80WoKh4Y bar = int(foo.(MyInt)) Chris -- Nothing to see here. Move along. -- You received this message because you are subs

[go-nuts] Just released AnyChart integration templates for data visualization with Go + MySQL +/- Revel

2016-12-20 Thread andrey . khachaturov
Hi all, We at AnyChart JS Charts have just released a series of 21 integration templates to help web developers add interactive charts, maps, stock

[go-nuts] Re: JSON smart parsing

2016-12-20 Thread C Banning
Don't know how to make 'X' simple, but you can use a strategy like https://play.golang.org/p/n4ms3hNGgy which at least minimizes allocations by only Unmarshal'ing the k:v pairs of interest. On Tuesday, December 20, 2016 at 8:48:03 AM UTC-7, Alexander Petrovsky wrote: > > Hello! > > By example I

[go-nuts] Re: How has your company adopted Go ?

2016-12-20 Thread JM
converted a web app from python to go. performance, simplicity, and keeping the team excited were the top, and also the only other contender that had a had a chance at the time was node js which was quickly eliminated for many reasons. I am doing consulting work for a fortune 50 company and al

Re: [go-nuts] Modern Garbage Collection Article

2016-12-20 Thread 'Alan Donovan' via golang-nuts
On 20 December 2016 at 11:17, wrote: > > compare 1 pointer in Go's string to 3 in java.lang.String > Sorry, "2 in java.lang.String". -- 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 i

Re: [go-nuts] Modern Garbage Collection Article

2016-12-20 Thread adonovan via golang-nuts
On Tuesday, 20 December 2016 00:31:52 UTC-5, Ian Lance Taylor wrote: > > [Go] is designed to let you control when and > how memory is allocated, giving you control over when memory is > allocated. The effect is that in Go you can adjust your program to > reduce GC overhead, rather than tuning t

Re: [go-nuts] basic hex encoding

2016-12-20 Thread Jan Mercl
On Tue, Dec 20, 2016 at 4:43 PM bsr wrote: > I mean, how 0x32 -> 2 String "32" -> byte 0x32 -> ASCII digit '2'. -- -j -- 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

[go-nuts] JSON smart parsing

2016-12-20 Thread Alexander Petrovsky
Hello! By example I have follow json {a:1, b:2, c:str, d:123, ..., z99: 1, z100: 10}, suppose it's veeery big json, and I don't need the whole fields in my little struct: Struct { a int `json:"a"` y int `json:"y"` } What I want? I want smart unmarshaler that can unmarshal my json to struct,

[go-nuts] basic hex encoding

2016-12-20 Thread bsr
sorry for such a trivial question, but my understanding of encoding on different bases are limited. In the below code https://play.golang.org/p/q-F0p00bie ``` package main import ( "encoding/hex" "fmt" ) func main() { id, err := hex.DecodeString("32") if err != nil { panic(err) } // id => [

Re: [go-nuts] CFG for a Go program

2016-12-20 Thread 'Alan Donovan' via golang-nuts
On 20 December 2016 at 10:07, wrote: > You mentioned it will be easier to use gc compiler's SSA representation. > By what commands can I get that SSA representation and is there any > documentation about the use of that representation. > The compiler is not structured as a library, and no, there

Re: [go-nuts] CFG for a Go program

2016-12-20 Thread akshanshchahal
Thank you very much. Those first 2 Github links are very helpful. You mentioned it will be easier to use gc compiler's SSA representation. By what commands can I get that SSA representation and is there any documentation about the use of that representation. On Sunday, December 18, 2016 at 10:37

[go-nuts] generic "CRUD" handlers

2016-12-20 Thread Thomas Bellembois
Hello, I have an application that define structures type Team struct { ID uint `gorm:"primary_key"` Name string `json:"Name"` } type MailingList struct { ID uint `gorm:"primary_key"` Name string `json:"Name"` Comment string `json:"Comment"` } ... and handlers to mana

[go-nuts] Re: howto: compile template against well-known structure ?

2016-12-20 Thread Egon
On Tuesday, 20 December 2016 14:30:28 UTC+2, Egon wrote: > > On Tuesday, 20 December 2016 13:07:05 UTC+2, mhh...@gmail.com wrote: >> >> That s interesting too, but it kills all the flexibility provided by >> template package. >> >> I mean, the button component i used as an example totally fits y

[go-nuts] Re: howto: compile template against well-known structure ?

2016-12-20 Thread Egon
On Tuesday, 20 December 2016 13:07:05 UTC+2, mhh...@gmail.com wrote: > > That s interesting too, but it kills all the flexibility provided by > template package. > > I mean, the button component i used as an example totally fits your DSL > approach, > but, this component extremely well defined i

Re: [go-nuts] howto: compile template against well-known structure ?

2016-12-20 Thread mhhcbon
Hi, thanks indeed might definitely be useful. i did a mess by importing some html type into my current project. +1 On Monday, December 19, 2016 at 3:43:44 PM UTC+1, Andy Balholm wrote: > > I don’t know if this will be helpful to you or not, but I’ve made a > package that is basically a copy/pa

[go-nuts] Re: howto: compile template against well-known structure ?

2016-12-20 Thread mhhcbon
That s interesting too, but it kills all the flexibility provided by template package. I mean, the button component i used as an example totally fits your DSL approach, but, this component extremely well defined in terms of both go structure and html structure, is quiet limited, IMHO. See thi

Re: [go-nuts] Channels of multiple values

2016-12-20 Thread Florin Pățan
An even better solution is to return a struct with the fields that you need. -- 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.

[go-nuts] Re: How to cast type alias and interface to int

2016-12-20 Thread so . query
Thanks! On Tuesday, December 20, 2016 at 1:13:35 AM UTC-8, Volker Dobler wrote: > > Like > bar = int(foo.(MyInt)) > that's: type-assert that foo is a MyInt and convert the MyInt to int. > > V. > > Am Dienstag, 20. Dezember 2016 09:45:33 UTC+1 schrieb so.q...@gmail.com: >> >> How would I cast

[go-nuts] Re: How to cast type alias and interface to int

2016-12-20 Thread Volker Dobler
Like bar = int(foo.(MyInt)) that's: type-assert that foo is a MyInt and convert the MyInt to int. V. Am Dienstag, 20. Dezember 2016 09:45:33 UTC+1 schrieb so.q...@gmail.com: > > How would I cast type alias MyInt and interface Foo, to an int? > > https://play.golang.org/p/Sb80WoKh4Y > -- Yo

[go-nuts] How to cast type alias and interface to int

2016-12-20 Thread so . query
How would I cast type alias MyInt and interface Foo, to an int? https://play.golang.org/p/Sb80WoKh4Y -- 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+