Re: [go-nuts] Deploying go https servers

2017-03-09 Thread Manlio Perillo
Il giorno venerdì 10 marzo 2017 05:43:44 UTC+1, Dragos Harabor ha scritto: > > Does this help? > https://blog.gopheracademy.com/advent-2016/exposing-go-on-the-internet/ > > Nginx will do much more things for you, in addition of providing additional "security": 1) Serve custom pages in case of Go

[go-nuts] Re: Any good suggestion for read/write ms excel .xlsx file?

2017-03-09 Thread Anssi Porttikivi
I wonder what is the state of art here now. Excelize looks promising. And there is https://github.com/aswjh/excel also. I've been thinking to choose between Python and Go here... Some Python stuff is here http://www.python-excel.org/ Any other alternative languages ot tools sets? On Thursday, 2

[go-nuts] Re: “invalid memory address” when calling Go from Python/C

2017-03-09 Thread Miki Tebeka
On Thursday, March 9, 2017 at 5:00:45 PM UTC+2, Miki Tebeka wrote: > > Hi There, > > (Originally posted on StackOverflow > , > > trying my luck here as well). > > I'm trying to extend the code in Ca

Re: [go-nuts] “invalid memory address” when calling Go from Python/C

2017-03-09 Thread Miki Tebeka
Thanks. Changing the error to a string worked. I'm trying to see how can I quickly reuse Go code from Python without too much wrapping. Seems like I can get get away with it :) On Thursday, March 9, 2017 at 9:45:30 PM UTC+2, Ian Lance Taylor wrote: > > On Thu, Mar 9, 2017 at 7:00 AM, Miki Tebeka

Re: [go-nuts] Deploying go https servers

2017-03-09 Thread Sankar P
Wow. This is a fantastic post. Thanks for sharing. I was expecting something like this only. 2017-03-10 10:13 GMT+05:30 Dragos Harabor : > Does this help? > https://blog.gopheracademy.com/advent-2016/exposing-go-on-the-internet/ > > On Wednesday, March 8, 2017 at 7:49:37 PM UTC-8, Sankar wrote: >

Re: [go-nuts] Deploying go https servers

2017-03-09 Thread Dragos Harabor
Does this help? https://blog.gopheracademy.com/advent-2016/exposing-go-on-the-internet/ On Wednesday, March 8, 2017 at 7:49:37 PM UTC-8, Sankar wrote: > > I am looking more for a checklist of things to do, rather than a set of > tools. > > 2017-03-09 0:38 GMT+05:30 Shawn Milochik > >: > >> That

Re: [go-nuts] memory gc when slice shortcut

2017-03-09 Thread Tim K
On Thursday, March 9, 2017 at 2:48:05 AM UTC-8, Jan Mercl wrote: > > On Thu, Mar 9, 2017 at 11:45 AM 代君 > > wrote: > > > I have a []*Struct, at some times it length grow to 1000, after that, > the slice be shortcut to length of 10, and never grow to 1000 again. > > dose the memory of *Struct at

[go-nuts] smartErr: nth post about error handling

2017-03-09 Thread mhhcbon
hi, Just wondering if one has considered to handle certain errors in such way, why / why not https://play.golang.org/p/Pc8Pv7d6eK I came to do an err struct like this, //SmartErr ... type SmartErr struct { error IsFatal bool IsEOA bool // End of application } //NewSmartErr ... fun

[go-nuts] Re: No Allman-Style, No go!

2017-03-09 Thread David Collier-Brown
We learned in the C era to /ALWAYS/ run code through indent(1) before comitting to source control. Otherwise we'd misread each other. -- 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

[go-nuts] Gracefully Shutdown File Server

2017-03-09 Thread Dave Cheney
Here is a short example I wrote for the Go 1.8 release party. https://talks.godoc.org/github.com/davecheney/go-1.8-release-party/presentation.slide#36 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop recei

[go-nuts] Gracefully Shutdown File Server

2017-03-09 Thread Andrew
Hi, How can I gracefully shutdown a file server like this in Go1.8? func main() { http.Handle("/", http.FileServer(http.Dir("./"))) http.ListenAndServe(":8080", nil) } Thanks, Andrew -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Re: struct initialization

2017-03-09 Thread mhhcbon
out of curiosity, is there any language which can handle the broken example ? imho i d declare ccv as an argument of newGlobal(), i d add an interface, so the argument is nillable, if the arg is nill, i d set it to a default ccv/whatever/ instance or i d make funcMap a method, func() funcMap O

Re: [go-nuts] struct initialization

2017-03-09 Thread Paulo Gabriel Poiati
I believe the `g` is only initialized after the declaration statement is completed. So you can't refer to the `g` name because it isn't available yet. You can do this: func newGlobalOptions() *globalOptions { ccv := ccvxml.New() g := &globalOptions{ ccv: ccv, funcMap: templ

[go-nuts] struct initialization

2017-03-09 Thread DrGo
Given this declaration type globalOptions struct { ... ccv *ccvxml.CCV funcMap template.FuncMap } Why this does not compile //Initialize template functions func newGlobalOptions() *globalOptions { g := globalOptions{ ccv: ccvxml.New(), funcM

Re: [go-nuts] How to install x/tools/cmd/goyacc?

2017-03-09 Thread Bakul Shah
On Thu, 09 Mar 2017 21:12:20 GMT Jan Mercl <0xj...@gmail.com> wrote: > > I am not able to help with an issue reported ( > https://github.com/cznic/goyacc/issues/23). I suggested to do > > $ go get -u golang.org/x/tools/cmd/goyacc > > but that does not seem to work. I tried this: go get -u ... w

[go-nuts] How to install x/tools/cmd/goyacc?

2017-03-09 Thread Jan Mercl
I am not able to help with an issue reported ( https://github.com/cznic/goyacc/issues/23). I suggested to do $ go get -u golang.org/x/tools/cmd/goyacc but that does not seem to work. I tried this: jnml@4670:~$ go get -u -v -x golang.org/x/tools/cmd/goyacc cd /home/jnml/src/golang.org/x/too

Re: [go-nuts] “invalid memory address” when calling Go from Python/C

2017-03-09 Thread Sebastien Binet
Miki, I believe that's a side-effect of the cgocheck pointer rules. if you add another testcase just before the call to lib.Div(1.2,2.3) such as: r = lib.Div(1,0) you'll see: Div called: x=1.00, y=0.00 panic: runtime error: cgo result has Go pointer goroutine 17 [running, locked to thre

Re: [go-nuts] “invalid memory address” when calling Go from Python/C

2017-03-09 Thread Ian Lance Taylor
On Thu, Mar 9, 2017 at 7:00 AM, Miki Tebeka wrote: > Hi There, > > (Originally posted on StackOverflow, trying my luck here as well). > > I'm trying to extend the code in Calling Go Functions from Other Languages. > I'd like see how a function returning an error can be handled. See the code > belo

Re: [go-nuts] Re: No Allman-Style, No go!

2017-03-09 Thread Michael Jones
This is a popular point of view in general (programming tools serve programmers) and the natural and most free spirit of free-form programming languages. It turns out that there is a good argument--an evidence-based theory of software development--that you might want to think about as you form you

Re: [go-nuts] Re: No Allman-Style, No go!

2017-03-09 Thread Sam Whited
> No Allman-Style, No go! It's worth noting that the difference between tabs and spaces is cosmetic and you're right, your editor could handle that for you, but Allman-style is more complex. Having opening braces on the same line is a matter of *syntax* in Go, not style; if you were to write the

[go-nuts] Need::Golang Spark Engineer::San Ramon, CA::6+ Months

2017-03-09 Thread Deepak Kumar
*Title: Spark Engineer* Interview: Phone & WebEx Number of Positions: 6 Location: San Ramon, CA Duration: 6+ Months *Must Have: Golang (Programming language) skills please* *For specific Spark skills you will want to look for the following:* · Scala or Python (primarily be Sc

[go-nuts] Re: No Allman-Style, No go!

2017-03-09 Thread thecoffeeboy
I see this as an opportunity for a smart ide dev to solve a problem. This argument/divide/preference should not exist. We're talking about tokens that are interpreted by a machine - how those tokens are display on screen in an editor should never have depended on the damn white space/tabs etc s

Re: [go-nuts] How to render a single webpage without templates?

2017-03-09 Thread st ov
Oh I see, so I need to treat all the elements as individual requests and specifically handle each. Thanks! On Thursday, March 9, 2017 at 12:59:13 AM UTC-8, Axel Wagner wrote: > > By writing the corresponding code :) For example: > > package main > > import ( > "log" > "net/http" > ) > > func Se

Re: [go-nuts] Sample code with races needed for presentation

2017-03-09 Thread Haddock
Thanks, Ian. There is plenty of stuff there ;-). Am Donnerstag, 9. März 2017 00:20:33 UTC+1 schrieb Ian Lance Taylor: > > On Wed, Mar 8, 2017 at 2:51 PM, Haddock > > wrote: > > > > I'm working on a comparison between concurency in Go and on the JVM. For > > that reason I would like to show som

[go-nuts] scriptable rules?

2017-03-09 Thread Tieson Molly
Are there any good libraries or packages to handle complex rule sets dynamically? I was thinking either some sort of embedded Prolog in Go or maybe Lua, but maybe someone knows of something simpler? Best regards, Ty -- You received this message because you are subscribed to the Google Group

Re: [go-nuts] memory gc when slice shortcut

2017-03-09 Thread Marvin Renich
* 代君 [170309 05:45]: > I have a []*Struct, at some times it length grow to 1000, after that, the > slice be shortcut to length of 10, and never grow to 1000 again. > > dose the memory of *Struct at slice's tail will never be gc? What Jan says is correct, but if your program logic can determine

[go-nuts] “invalid memory address” when calling Go from Python/C

2017-03-09 Thread Miki Tebeka
Hi There, (Originally posted on StackOverflow , trying my luck here as well). I'm trying to extend the code in Calling Go Functions from Other Languages. I'd like see how a function returning an er

[go-nuts] oauth2: Any interest in mainlining support for Google's device token flow?

2017-03-09 Thread Saj Goonatilleke
Hello, Google's OAuth 2.0 implementation supports a flow they have termed 'OAuth 2.0 for TV and Limited-Input Device Applications'[1]. This flow is roughly analogous to, but IIRC not compatible with, draft-ietf-oauth-device-flow[2]. Together with OIDC, we plan to incorporate this flow into

Re: [go-nuts] watching for directory/file changes using golang/windows

2017-03-09 Thread ranjukr
Hi DisposeBoy, I am using it. Its really cool. But I want to use it for some changes in some cloud directory. How can I do that? On Sunday, July 1, 2012 at 6:10:18 PM UTC+5:30, DisposaBoy wrote: > > > > On Sunday, July 1, 2012 1:34:23 PM UTC+1, Bhaskar teja Yerneni wrote: >> >> Thanks Dave, could

[go-nuts] Re: sort.Slice arguments

2017-03-09 Thread 代君
modify your code like this: ```go package main import ( "fmt" "sort" ) func main() { // // I am in Philadelphia, and I want to visit other cities // itinerary := []string{"Philadelphia", "Chicago", "Boston", "Austin", "Def"} // // I am in Philadelphia, and I want to visit other cities in alphabe

Re: [go-nuts] memory gc when slice shortcut

2017-03-09 Thread Jan Mercl
On Thu, Mar 9, 2017 at 11:45 AM 代君 wrote: > I have a []*Struct, at some times it length grow to 1000, after that, the slice be shortcut to length of 10, and never grow to 1000 again. > dose the memory of *Struct at slice's tail will never be gc? It will not be garbage collected because it's poss

[go-nuts] memory gc when slice shortcut

2017-03-09 Thread 代君
I have a []*Struct, at some times it length grow to 1000, after that, the slice be shortcut to length of 10, and never grow to 1000 again. dose the memory of *Struct at slice's tail will never be gc? -- You received this message because you are subscribed to the Google Groups "golang-nuts" gro

Re: [go-nuts] How to render a single webpage without templates?

2017-03-09 Thread 'Axel Wagner' via golang-nuts
By writing the corresponding code :) For example: package main import ( "log" "net/http" ) func ServeIndex(res http.ResponseWriter, req *http.Request) { http.ServeFile(res, req, "index.html") } func main() { http.HandleFunc("/", ServeIndex) http.Handle("/img/", http.StripPrefix("/img/", http.Fi