Re: [go-nuts] Re: REST API - Request Logging on Server

2017-07-17 Thread desaiabhijit
Hi Jesper Thanks for the reply Do you need to log every request? yes.. supporting minimum 200 req/sec per machine Do you need to know the contents of the request? yes.. it's a search request having 6 parameters ( XML/JSON REST ) Need to log all the requests for BI purpose so can't limit loggi

[go-nuts] Programming paradigm.

2017-07-17 Thread Patrick Logan
If you want to do FP and only FP then you will be heartsick for an ML-like language and should use one of those. However there is a lot of room between "no FP" and "only FP"... call this "semi-functional" and Go accommodates this well. -- You received this message because you are subscribed to

[go-nuts] Programming paradigm.

2017-07-17 Thread Henry
This has me piqued. How do you do recursion without tail call optimization? As far as I know, Go compiler doesn't do tail call optimization. The heart of FP lies in the composability of function. Go supports higher order function, so you can compose functions albeit in a limited way. Without gen

Re: [go-nuts] encoding/csv: Is this a bug?

2017-07-17 Thread Matt Harden
I suspect that this has to do with the line-ending characters on a Mac. I think Excel is writing the file with each line ending with a CR character. The encoding/csv package expects RFC 4180 format (each line terminated with CRLF), which is what Excel writes when you select "Windows Comma Separated

[go-nuts] An idea about motivating the community

2017-07-17 Thread Nate Finch
(sorry for the duplicate post, the other one disappeared) I wrote a tweet after Gophercon about making a resolution to write more blog posts. I used the hashtag #GopherResolution with the hope that other people might pick up the idea and run with it. So far, however, only one other person has

Re: [go-nuts] Re: [Go2] toward-go2

2017-07-17 Thread Ian Lance Taylor
On Mon, Jul 17, 2017 at 5:13 PM, Gert wrote: > > Let me ask it differently what is going to happen with all the Go2 labeled > issues on github? They will be considered over time as we try to figure out what might make sense for Go 2. > For me experience report is nothing different then a > gith

[go-nuts] Re: [Go2] toward-go2

2017-07-17 Thread Gert
Let me ask it differently what is going to happen with all the Go2 labeled issues on github? For me experience report is nothing different then a github issue and also nobody of the go team will be able to handle all the incoming false positives of people like me that think have a great idea but

[go-nuts] encoding/csv: Is this a bug?

2017-07-17 Thread Dat Huynh
Hi all, I have a problem with parsing a .csv file using the library "encoding/csv". I wonder if that is the problem of Microsoft Excel or the Go library. I am using Microsoft Excel version 14.2.2 on MacOS and go1.8.3 darwin/amd64 What did I do? Firstly I input the below values into an Excel sh

Re: [go-nuts] Re: Can't explain Golang benchmarks

2017-07-17 Thread Jesper Louis Andersen
On Mon, Jul 17, 2017 at 10:14 PM Zohaib Sibte Hassan < zohaib.has...@gmail.com> wrote: > So the scenario I am trying to implement is basically a chat scenario. > My first approach would be to measure. * The full system will have a bottleneck as per Amdahl's law. You need to take a holistic view

Re: [go-nuts] Error: opcode not supported on this processor: mips32

2017-07-17 Thread Ian Lance Taylor
On Mon, Jul 17, 2017 at 12:53 PM, Sander van Harmelen wrote: > > I’m trying to cross compile > https://github.com/google/gousb/tree/master/lsusb from macOS to mipsle using > the following cmd: > >> GOOS=linux GOARCH=mipsle CGO_ENABLED=1 CC=mipsel-openwrt-linux-gcc >> CFLAGS=-I../include/ go build

Re: [go-nuts] Deleted post?

2017-07-17 Thread Wojciech S. Czarnecki
On Mon, 17 Jul 2017 13:52:17 -0700 (PDT) Nate Finch wrote: > I guess my previous post was deleted? Can a mod contact me about it please? > Recently I got into my inbox yours: > From: Nate Finch > To: golang-nuts > Subject: [go-nuts] An idea about motivating the community > Date: Mon, 17 Jul 2

[go-nuts] Deleted post?

2017-07-17 Thread Nate Finch
I guess my previous post was deleted? Can a mod contact me about it please? -- 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.c

Re: [go-nuts] slow Mod function in math/big, a better way?

2017-07-17 Thread Rémy Oudompheng
2017-07-17 15:56 GMT+02:00 Jeff Templon : > Coming back to this, now that my Go knowledge is increasing: > > On Saturday, July 8, 2017 at 5:58:59 PM UTC+2, Andy Balholm wrote: >> >> I noticed your “naive explanation” after I sent my message. But I think it >> is the real explanation. > > > it turns

Re: [go-nuts] slow Mod function in math/big, a better way?

2017-07-17 Thread Jan Mercl
On Mon, Jul 17, 2017 at 7:18 PM Jeff Templon wrote: > Sure: I hoped for a number of which you don't know the factors and wanted to cheat by linking to factordb.com ;-) Earlier you wrote also > it turns out that 77% of the time of the program is spent in runtime.mallocgc :-) I think the reason

Re: [go-nuts] Re: Can't explain Golang benchmarks

2017-07-17 Thread Michael Jones
I get about 3 million channel send/receive pairs per second. If you actually do work inbeteeen (database access, computation, etc.) the limit is difficult to reach. On Mon, Jul 17, 2017 at 10:22 AM Jesper Louis Andersen < jesper.louis.ander...@gmail.com> wrote: > Your benchmarks are not really *d

Re: [go-nuts] Re: Can't explain Golang benchmarks

2017-07-17 Thread Zohaib Sibte Hassan
Hey Jesper, Thanks for such an insightful reply. So the scenario I am trying to implement is basically a chat scenario. With huge chat rooms (thousands of people) situation, all the listener threads are going to run into this situation (which is exactly what I am doing here). To elaborate a li

[go-nuts] Error: opcode not supported on this processor: mips32

2017-07-17 Thread Sander van Harmelen
Hi, I’m trying to cross compile https://github.com/google/gousb/tree/master/lsusb from macOS to mipsle using the following cmd: > GOOS=linux GOARCH=mipsle CGO_ENABLED=1 CC=mipsel-openwrt-linux-gcc > CFLAGS=-I../include/ go build But I receiv

Re: [go-nuts] Re: REST API - Request Logging on Server

2017-07-17 Thread Jesper Louis Andersen
Do you need to log every request? Do you need to know the contents of the request? Metrics are far cheaper to maintain than a log line. Also, consider sampling, or only logging slow requests (though put a limit on them over a period: when your system goes wrong you don't want all the slow logging r

Re: [go-nuts] Re: Can't explain Golang benchmarks

2017-07-17 Thread Jesper Louis Andersen
Your benchmarks are not really *doing* something once they get data. This means that eventual conflicts on (internal or external) locks are going to be hit all the time. In turn, you are likely to measure the performance of your hardware in the event of excessive lock contention (this hypothesis ca

Re: [go-nuts] slow Mod function in math/big, a better way?

2017-07-17 Thread Jeff Templon
Hi Jan, On Monday, July 17, 2017 at 4:20:21 PM UTC+2, Jan Mercl wrote: > > > Just for fun: Please provide a sample in that range. > Sure: medina:gofact> time ./factorize -r -M 191 factoring 3138550867693340381917894711603833208051177722232017256447 factors [ 383 7.068.569.257 39.940.132.241

[go-nuts] Re: REST API - Request Logging on Server

2017-07-17 Thread desaiabhijit
Hi Nate Thanks very much for the info Rgds, Abhi On Monday, July 17, 2017 at 10:19:58 PM UTC+5:30, Nate Finch wrote: > > Basically any log package will be pretty quick. None of them will be > zero overhead, that's impossible, but most will not affect the time of your > requests terribly si

[go-nuts] Re: Programming paradigm.

2017-07-17 Thread Tong Sun
I feel the following is an eye-opening reading for doing functional programming in Go: https://blog.gopheracademy.com/advent-2016/go-syntax-for-dsls/ On Monday, July 17, 2017 at 12:14:40 PM UTC-4, Patrick Logan wrote: > > I've not had any trouble doing functional programming in Go. Here's a >

[go-nuts] Re: REST API - Request Logging on Server

2017-07-17 Thread Nate Finch
Basically any log package will be pretty quick. None of them will be zero overhead, that's impossible, but most will not affect the time of your requests terribly significantly. I personally like logrus (https://github.com/sirupsen/logrus) for structured logging, it has a lot of adapters a

[go-nuts] Programming paradigm.

2017-07-17 Thread Patrick Logan
I've not had any trouble doing functional programming in Go. Here's a snippet of a combinator-based parseri wrote... https://bitbucket.org/snippets/patrickdlogan/kE9bn/fp-in-go-is-not-bad-considering-the-simple -- You received this message because you are subscribed to the Google Groups "golan

Re: [go-nuts] few questions about runtime implementation

2017-07-17 Thread Hiroshi Ioka
I see. Thanks. Sent with Unibox > On Jul 18, 2017, at 1:03 AM, Aram Hăvărneanu wrote: > > >> nitpick. os3_solaris.go.go set stack size by itself, instead of >> using default one. is it intentional? >> > > > > > You mean why does it explicitely ask for a 2MB stack when 2MB stacks > ar

Re: [go-nuts] few questions about runtime implementation

2017-07-17 Thread Aram Hăvărneanu
> nitpick. os3_solaris.go.go set stack size by itself, instead of > using default one. is it intentional? You mean why does it explicitely ask for a 2MB stack when 2MB stacks are the default? I can't remember the exact reason I did that but it was a workaround for some sort of bug. -- Aram Hăvăr

Re: [go-nuts] few questions about runtime implementation

2017-07-17 Thread 井岡裕史
s/sys_solaris_amd64.go/os3_solaris.go/ -- 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://g

Re: [go-nuts] few questions about runtime implementation

2017-07-17 Thread 井岡裕史
Thank you for your detailed answer. 1. I'm convinced. I understand that I don't have to consider the difference in general. > On Solaris there is no difference because they create threads the same way in all cases. nitpick. sys_solaris_amd64.go set stack size by itself, instead of using default

[go-nuts] REST API - Request Logging on Server

2017-07-17 Thread desaiabhijit
Wanted to log request for REST Api on Linux with 0 ms delay on serving REST output REST Api server - Gin Reverse proxy - Varnish ( which not allow to log request ) Please anyone suggest any library Thanks in advance Rgds, Abhi -- You received this message because you are subscribed to the G

[go-nuts] golang and openembedded integration

2017-07-17 Thread Lee Nipper
I am adding some go components to an openembedded / yocto based project. My question is about a reasonable approach for go building and integration with oe. I am aware of the work done already to address golang within oe, specifically https://github.com/madisongh/meta-golang/tree/master. This wo

Re: [go-nuts] slow Mod function in math/big, a better way?

2017-07-17 Thread Jan Mercl
On Mon, Jul 17, 2017 at 4:09 PM Jeff Templon wrote: > Generally I'm factoring numbers that I can do in less than a day, so in the order of 60 to 100 decimal digits. Just for fun: Please provide a sample in that range. -- -j -- You received this message because you are subscribed to the Goog

Re: [go-nuts] slow Mod function in math/big, a better way?

2017-07-17 Thread Jeff Templon
Hi Generally I'm factoring numbers that I can do in less than a day, so in the order of 60 to 100 decimal digits. JT On Monday, July 17, 2017 at 4:02:29 PM UTC+2, Jan Mercl wrote: > > On Mon, Jul 17, 2017 at 3:57 PM Jeff Templon > wrote: > > > Coming back to this, now that my Go knowledge is

[go-nuts] Re: [Bug Report] Cannot run GO in Windows Server 2016

2017-07-17 Thread Egon
Have you tried go1.9beta2? Maybe it's already fixed? https://golang.org/dl/#unstable If not then make a bug report to: https://github.com/golang/go/issues + Egon On Monday, 17 July 2017 06:27:38 UTC-7, yanfeizh...@gmail.com wrote: > > [Issue] > When running go, a problem is encountered > --

Re: [go-nuts] slow Mod function in math/big, a better way?

2017-07-17 Thread Jan Mercl
On Mon, Jul 17, 2017 at 3:57 PM Jeff Templon wrote: > Coming back to this, now that my Go knowledge is increasing: Out of curiosity, how big are the numbers you want to factorize? -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsu

Re: [go-nuts] slow Mod function in math/big, a better way?

2017-07-17 Thread Jeff Templon
Coming back to this, now that my Go knowledge is increasing: On Saturday, July 8, 2017 at 5:58:59 PM UTC+2, Andy Balholm wrote: > > I noticed your “naive explanation” after I sent my message. But I think it > is the real explanation. > it turns out that 77% of the time of the program is spent i

Re: [go-nuts] few questions about runtime implementation

2017-07-17 Thread Aram Hăvărneanu
> 1. Is there any noticeable benchmark difference between internal > linking and external linking? A benchmark testing what? > IIUC, when I use external linking, runtime/cgo is used for OS thread > creation. In that case Go doesn't allocate the system stack itself. It's more complicated than tha

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

2017-07-17 Thread emilien . kofman . sii
It looks like I have a similar issue with just a golang service trying to resolve the ip of another service through kube-dns. The error shows up when I submit a "large" number of requests within a few seconds. Do you have any update on this? Le mercredi 28 juin 2017 20:56:40 UTC+2, Luke Kysow a

[go-nuts] [Bug Report] Cannot run GO in Windows Server 2016

2017-07-17 Thread yanfeizhang2016a2
[Issue] When running go, a problem is encountered C:\Users\Administrator>go Exception 0xc005 0x8 0x0 0x0 PC=0x0 runtime.asmstdcall(0x8fdd8, 0x40ee8d, 0x10f4000, 0x0, 0x10044f980, 0x20, 0x11, 0x10f4000, 0x44f8c0, 0x10f, ...) c:/go/src/runtime/sys_windows_amd64.

[go-nuts] Re: Programming paradigm.

2017-07-17 Thread Egon
I suggest reading: https://medium.com/@egonelbre/paradigm-is-not-the-implementation-af4c1489c073 + Egon On Sunday, 16 July 2017 20:42:34 UTC-7, Mayank Acharya wrote: > > Dear all, > I am new to Go language. > > I searched a lot to understand it's paradigm structure but still not > getting clear

Re: [go-nuts] Named or unnamed struct initialisation? What is best practice?

2017-07-17 Thread roger peppe
Sometimes I'll use non-named-member initialisation for small structs with a well known set of fields (for example, a Point with X and Y coordinates), but otherwise I much prefer named initialisation (go vet will warn if you don't, in fact). I'll almost always put each field onto its own line too -

[go-nuts] An idea about motivating the community

2017-07-17 Thread Nate Finch
I wrote a tweet after Gophercon about making a resolution to write more blog posts. I used the hashtag #GopherResolution with the hope that other people might pick up the idea and run with it. So far, however, only one other person has used the tag. There are studies on the effects of makin

[go-nuts] Programming paradigm.

2017-07-17 Thread Henry
Go is an imperative programming language, so it will be difficult to do any functional programming in Go. However, beyond that, Go does not lock you into any particular programming paradigm. You are free to choose anything from procedural to object oriented or anything in between and beyond. Go

[go-nuts] few questions about runtime implementation

2017-07-17 Thread hirochachacha
Hi, I have few questions out of curiosity. 1. Is there any noticeable benchmark difference between internal linking and external linking? IIUC, when I use external linking, runtime/cgo is used for OS thread creation. In that case Go doesn't allocate the system stack itself. So, I assume ther

[go-nuts] "interface{} says nothing", lets consider it destroys information

2017-07-17 Thread mhhcbon
in func do(i interface{}) interface{} (return i), do says nothing because "interface{} says nothing", from the caller pov, it looses information at the return call, var x = "o" do(x) // <- return lost the track it was a string if you delegate that func to another func, it can t says anything