[go-nuts] Re: sharing "go runtime VM" for many go application

2016-11-28 Thread Dave Cheney
Go is not a virtual machine language, it's compiled to native machine code, like a C program. Each Go program does have a runtime package which provides the garbage collector to manage the programs heap, and Go programs do follow a pattern of over allocating with the expectation that the

[go-nuts] Re: sharing "go runtime VM" for many go application

2016-11-28 Thread Thaniyarasu Kannusamy
thanks Dave, i am thinking about server less architecture with golang. i feel that "sharing languange runtime/VM" will be next technology than the container/kubernetes era. already aws offering lambda service for serverless architecture. i know that nodejs is running in sandbox mode with event

Re: [go-nuts] Re: need library suggestions on writing a record program

2016-11-28 Thread biatche
The above is what the present DOS program looks like. Within each section are simply input/text fields. This certain old man who wants this done doesn't want a

[go-nuts] sharing "go runtime VM" for many go application

2016-11-28 Thread Dave Cheney
No, this is not currently possible. If it was possible in the future, what would this let you do that you cannot do today? -- 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

[go-nuts] sharing "go runtime VM" for many go application

2016-11-28 Thread Thaniyarasu Kannusamy
we all knows that sharing "Linux Kernel" is possible in container world. i also want to know further that, is sharing "Go Runtime VM" is possible in anyway ? so we can able to share a common "Go Runtime VM" for many go application. if that is possible then we can able to run 'Go Runtime VM'

Re: [go-nuts] Re: need library suggestions on writing a record program

2016-11-28 Thread Jason Playne
If you really must use a terminal ui - maybe try https://github.com/gizak/termui it seems quite nice. if you can make people SSH into your app (using some golang ssh server magic) that might be a way to go as well. Otherwise go for a web based solution (as layout would be much easier) On 29

Re: [go-nuts] bug report?: go font box drawing is wrong

2016-11-28 Thread Nigel Tao
On Mon, Nov 28, 2016 at 5:28 PM, wrote: > Sorry if this is the wrong place. This place is as good as any other. Thanks for the bug report. I'll pass it on to Bigelow & Holmes. -- You received this message because you are subscribed to the Google Groups "golang-nuts"

[go-nuts] Sendgrid on App Engine urlfetch client instead of defaulthttp client

2016-11-28 Thread vanmulders1992
I'm running my API backend in Go on App Engine When a user creates an account, he gets sent an activation email. The normal tutorial for this doesn't work since App engine refuses the default http client and I have the urlfetch one I've been trying to figure this out for hours but can't seem

[go-nuts] Re: multiple html templates

2016-11-28 Thread Jon Calhoun
What you are doing seems pretty normal. You could technically parse each HTML file into it's own template and then just use baseTemplate.Execute(...) and dataTemplate.Execute(...) in your code instead, but I really doubt what you are doing has a noticeable performance hit (if it even

[go-nuts] Heap fragmentation due to protobuffs serialization/de-serialization

2016-11-28 Thread Dave Cheney
It looks ok to me, the svg.released number is growing which suggests that fragmentation is not an issue. -- 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

[go-nuts] Re: net/http and errors.

2016-11-28 Thread Dave Cheney
Indeed. Does your program differentiate between a URL not resolving, the webserver at the other end being down or refusing to connect, or it returnining a non temporary fatal error, 4xx? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Re: net/http and errors.

2016-11-28 Thread James Bardin
If you want to assert your way down to the original error, the order of the structures returned from http.Get is: if err, ok := err.(*url.Error); ok { if err, ok := err.Err.(*net.OpError); ok { if err, ok := err.Err.(*net.DNSError); ok { fmt.Println("DNS ERROR:", err) } } } Again though, the

[go-nuts] Re: need library suggestions on writing a record program

2016-11-28 Thread Rick
I've written a small program for work in gocui and am quite happy with the results. On Monday, 28 November 2016 08:12:35 UTC-8, bia...@gmail.com wrote: > > i'd like to rewrite an old dos medical patient record program in go for a > friend. its not a complex program by any means > > i'd probably

Re: [go-nuts] Can anyone explain this section of the unicode/utf8 test suite?

2016-11-28 Thread Jan Mercl
On Mon, Nov 28, 2016 at 7:18 PM Pietro Gagliardi wrote: > What is this supposed to be doing? I tried going through the git history to find any context and the only thing I can figure is that there are lots of leftovers from super early Go (in fact, this whole test suite is

Re: [go-nuts] need library suggestions on writing a record program

2016-11-28 Thread Justin Israel
Does a replacement have to be a terminal app or is that just to match the legacy look and feel? I haven't written apps in a terminal UI before, but I have spent many years writing Qt applications, so I would probably reach for Qt via https://github.com/therecipe/qt If you haven't written any Go

[go-nuts] Can anyone explain this section of the unicode/utf8 test suite?

2016-11-28 Thread Pietro Gagliardi
Not sure if this belongs here or golang-dev, but... I'm copying the unicode/utf8 and unicode/utf16 tests for my own C library that also deals with UTF-8 and UTF-16 (because why not), and there's one thing I'm confused about in the former:

Re: [go-nuts] Heap fragmentation due to protobuffs serialization/de-serialization

2016-11-28 Thread Ian Lance Taylor
On Mon, Nov 28, 2016 at 8:00 AM, Devanand Reddy wrote: > > We are using protocol buffers extensively in our application. We have a > suspect that over the time, due to excessive marshaling/un-marshaling these > two operations are causing heap fragmentation. One factor

Re: [go-nuts] Problem with code!

2016-11-28 Thread Seth Bunce
You may be missing a "continue" in your "if cont == 0" block. Seth On Nov 28, 2016 7:33 AM, "Sergio Hunter" wrote: > Hi everybody. I need help. When outputting data to a csv file, the dates > is duplicated, but should merge and be counted. How to write correctly? > Thanks. >

[go-nuts] Re: net/http and errors.

2016-11-28 Thread mb . dhananjay
I'm downloading a large number of urls and the result is expected to have failure reasons, DNS lookup failed being one. calling lookup manually would solve my issue, I suppose. Just wanted to make sure that I'm not missing any obvious solutions. 1. lookup DNS and if it succeeds, 2. try

Re: [go-nuts] Problem with code!

2016-11-28 Thread Shawn Milochik
Just a Go map -- like you're already using elsewhere in the code. It's the same as a hash in Perl or a dict in Python -- you can't have duplicate keys. So if you create a map that has the date as the key and anything as the value (an empty struct is idiomatic, but you can also use a boolean),

Re: [go-nuts] Problem with code!

2016-11-28 Thread Sergio Hunter
I can't understand about "map", Could you explain me please? понедельник, 28 ноября 2016 г., 18:35:54 UTC+2 пользователь Shawn Milochik написал: > > The dates are just being appended without being checked for duplication: > > for userStats := range userStatsData.Dates { >

Re: [go-nuts] Problem with code!

2016-11-28 Thread Shawn Milochik
The dates are just being appended without being checked for duplication: for userStats := range userStatsData.Dates { dates = append(dates, userStats) } You could use a map for this. Also, check your errors: data, _ = ioutil.ReadAll(r) If the first "if" block for

Re: [go-nuts] Re: Bloom filter

2016-11-28 Thread Ian Davis
On Sat, Jan 25, 2014, at 07:17 AM, greg.z...@gmail.com wrote: > Hello, I seem to be unable to Unmarshal a bitset over size 32.. What have you tried and what errors did you encounter? If you share some code then your question will be easier to answer. -- You received this message because

[go-nuts] need library suggestions on writing a record program

2016-11-28 Thread biatche
i'd like to rewrite an old dos medical patient record program in go for a friend. its not a complex program by any means i'd probably use go-sqlite3 for storage but its the terminal part where I'm confused. should i use gocui or termbox directly? the program will only have menus to be

[go-nuts] Re: Bloom filter

2016-11-28 Thread xrfang
Hi Will, Could you please explain the memory characteristics of your implementation? i.e. given boom.New(m, k), how much memory will the filter consume? Is the memory consumption related to number of items in the filter? If appropriate, function such as func EstimateParameterByMemory(mem

Re: [go-nuts] Deleting the /r/golang subreddit

2016-11-28 Thread Craig
I took the same interpretation ("rankist", not sexist). Still an ad hominem. On Mon, Nov 28, 2016 at 9:32 AM Andy Balholm wrote: > I took the usage of “men” in that comment to be gender-neutral. I read it > as “Are you rankist?", not as “Are you sexist or rankist?” > > (I

[go-nuts] Problem with code!

2016-11-28 Thread Sergio Hunter
Hi everybody. I need help. When outputting data to a csv file, the dates is duplicated, but should merge and be counted. How to write correctly? Thanks. package main import ( "database/sql" "log" _"github.com/go-sql-driver/mysql" "compress/zlib" "bytes"

Re: [go-nuts] Deleting the /r/golang subreddit

2016-11-28 Thread Andy Balholm
I took the usage of “men” in that comment to be gender-neutral. I read it as “Are you rankist?", not as “Are you sexist or rankist?” (I don’t know if rankist is a word, but I mean someone who discriminates on the basis of rank.) Andy > On Nov 27, 2016, at 6:43 PM, vac...@gmail.com wrote: > >

[go-nuts] Re: Deleting the /r/golang subreddit

2016-11-28 Thread Art Mellor
I think some readers are missing the OP's attempt to invoke the wise words of Obi Wan Kenobi: https://www.youtube.com/watch?v=0znNiN0lYAQ On Thursday, November 24, 2016 at 8:57:22 PM UTC-6, Nathaniel Nutter wrote: > > Are all 25,171 subscribers scum and villainy? As a someone that reads >

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

2016-11-28 Thread adonovan via golang-nuts
On Monday, 28 November 2016 09:04:55 UTC-5, atd...@gmail.com wrote: > > > I concur. > > On Monday, November 28, 2016 at 4:35:13 AM UTC+1, Michael Jones wrote: >> >> Details of this would make a great Go Blog post… >> > There is certainly a dearth of documentation on how to make the key design

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

2016-11-28 Thread atd...@gmail.com
I concur. On Monday, November 28, 2016 at 4:35:13 AM UTC+1, Michael Jones wrote: > > Details of this would make a great Go Blog post… > > > > *From: *adonovan via golang-nuts > *Reply-To: * > *Date: *Sunday, November 27, 2016 at 6:07 PM > *To:

[go-nuts] Re: Extracting link to earlier panic

2016-11-28 Thread Matt Joiner
^ On Friday, 25 November 2016 14:02:29 UTC+11, Matt Joiner wrote: > > I can't see anyway to extract earlier panics per runtime's _panic.link. > This makes it difficult to print stack traces in the way that the default > handler does if a panic is not recovered. > > I want to recover a panic,

[go-nuts] Re: Hide struct fields from frontend code (JSON REST API)

2016-11-28 Thread Mirco Zeiss
Sorry, but it won't work. I'm using the same marshal method when communicating with my DB as when communicating to my frontend. How can I tell it to sometimes leave out the private fields and sometimes not? On Monday, November 28, 2016 at 6:43:26 AM UTC+1, Mirco Zeiss wrote: > > That might

[go-nuts] Re: net/http and errors.

2016-11-28 Thread Dave Cheney
What specifically do you want to handle about DNS errors ? If you have a set of possible dns names and you don't know if some of them are valid, you could use net.LookupHost to check which ones are valid before calling http.Get. On Monday, 28 November 2016 22:44:37 UTC+11, mb.dha...@gmail.com

[go-nuts] Re: How could I do bulk insert with "INSERT INTO xxx(..) VALUE(?,?,?),(?,?,?),(?,?,?) ON DUPLICATE KEY UPDATE xxx=?,xxx=?;"

2016-11-28 Thread mworks092
Ok, I got the answer. First I prepared the VALUES(?,?) by putting the (?,?,?) together. Second, using vals of type []interface{} I can append every member of the DataAccessObject to vals like: vals = append(vals, np.Port). Finally all things have been done with normal stmt, err := db.Prepare(),

[go-nuts] Re: net/http and errors.

2016-11-28 Thread mb . dhananjay
But AFIU, err.Temporary() could be true for other kind of errors that might happen, isn't that a problem if I only want to handle DNS errors? On Friday, November 25, 2016 at 6:35:59 PM UTC+1, Victor Vrantchan wrote: > > In Go, you can check if a type satisfies a particular behavior by >

Re: [go-nuts] Type statement in blocks vs global

2016-11-28 Thread Jan Mercl
On Mon, Nov 28, 2016 at 12:21 PM wrote: > Since a type can only be declared once in a scope, the order in which they are declared shouldn't matter ? It matters depending on which scope it is. From https://golang.org/ref/spec#Declarations_and_scope ...

Re: [go-nuts] Type statement in blocks vs global

2016-11-28 Thread paraiso . marc
I'm not sure what you mean. types that reference each others in a type declaration are allowed when declared globally , but not in a block ( ? ) i.e. : declaring Foo and Bar outside main would work , declaring them inside main doesn't . I wanted to declare them inside an example function in

Re: [go-nuts] Type statement in blocks vs global

2016-11-28 Thread Jan Mercl
On Mon, Nov 28, 2016 at 11:46 AM wrote: > Is there an alternative aside from declaring types globally ? Unfortunately, the problem to solve is not defined, only the solution tried and failed is, so I don't know if this can help: https://play.golang.org/p/9btAagXDpM --

[go-nuts] How could I do bulk insert with "INSERT INTO xxx(..) VALUE(?,?,?),(?,?,?),(?,?,?) ON DUPLICATE KEY UPDATE xxx=?,xxx=?;"

2016-11-28 Thread mworks092
Hi everyone! I met a problem in my project where I want to do INSERT ON DUPLICATE KEY UPDATE with around 3,000 records once. It seems like golang didn't support bulk insert . I was confused if it will lead MySQL inject risk if I just do put the sql pieces together, it will looks like:

Re: [go-nuts] Checking whether html/css toggle switch has been set to on/off position in go

2016-11-28 Thread Konstantin Khomoutov
On Mon, 28 Nov 2016 11:50:26 +0300 Konstantin Khomoutov wrote: [...] > > I do have my go handler configured, as well as my ws function in > > javascript configured to be triggered on the click of a button. > > Forgot to mention this. right now on the click of a

Re: [go-nuts] Checking whether html/css toggle switch has been set to on/off position in go

2016-11-28 Thread Konstantin Khomoutov
On Mon, 28 Nov 2016 03:37:32 -0500 Chris S wrote: > Thanks for the response Konstantin, > > I do have my go handler configured, as well as my ws function in > javascript configured to be triggered on the click of a button. > Forgot to mention this. right now on the

Re: [go-nuts] Checking whether html/css toggle switch has been set to on/off position in go

2016-11-28 Thread Konstantin Khomoutov
On Sun, 27 Nov 2016 22:33:33 -0800 (PST) Chris S wrote: [...] > I currently have my html file set up with a button and this toggle > switch. I also configured my webserver in go to be listening on > localhost:8080. And I have a websocket handler configured, so that I >