[go-nuts] about the []byte -> string comversion optimization, is it some weird?

2017-04-17 Thread T L
package main import "fmt" import "testing" var s string var a = make([]byte, 1000) func f0() { x := string(a) s = x + x + x + x + x + x + x + x + x + x } func f1() { s = string(a) + string(a) + string(a) + string(a) + string(a) + stri

Re: [go-nuts] http.Server handlers seem to stick around forever

2017-04-17 Thread Peter Mogensen
On 2017-04-18 07:18, Peter Mogensen wrote: On 2017-04-18 05:48, Ken Simon wrote: go srv.Serve(l) Have you tried check the error return value here? Sorry... I was a bit too quick. That error shows accept error on close as its supposed to. However... If you call net/http.Server.Close()

Re: [go-nuts] http.Server handlers seem to stick around forever

2017-04-17 Thread Peter Mogensen
On 2017-04-18 05:48, Ken Simon wrote: go srv.Serve(l) Have you tried check the error return value here? /Peter -- 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

[go-nuts] Rubigo: Golang dependency tool and package manager

2017-04-17 Thread yaa110
Homepage: https://github.com/yaa110/rubigo Rubigo is a dependency tool and package manager for Golang, written in Rust. Rubigo uses vendor directory (starting from Go 1.5) to install packages, however it is possible to add packages globally (in GOPATH/src directory) or make a local package in v

[go-nuts] http.Server handlers seem to stick around forever

2017-04-17 Thread Ken Simon
Hello golang-nuts! I have some code that creates a short-lived HTTP server, and I'm trying to write tests for it. I'm hitting a case where HTTP handlers seem to stick around even though I'm creating a brand new `http.ServeMux`, `http.Server`, and `net.Listener` objects. How do I get rid of ol

[go-nuts] OpenGL Fonts

2017-04-17 Thread saif
Hi, I like to ask for your suggestions. I found a nice project, and was trying to modify them but got stuck with fonts. (github.com/dskinner/material) I like the fonts to be configurable, but when I tried to parse the fonts at runtime, it seems slow. The idea from the example is to preparse f

Re: [go-nuts] Link documentation sources

2017-04-17 Thread anatoly techtonik
It still would be nice to trace back to these sources to fix them, and describe the syntax for cross-linking. On Tue, Apr 18, 2017 at 4:30 AM, Stas Maksimov wrote: > I believe this documentation is built from comments in the source code: > https://go.googlesource.com/go/+/go1.8.1/src/path/path.go

[go-nuts] Re: ast - Missing Ident.Obj

2017-04-17 Thread Diego Medina
Thanks, I'll go ahead and prepare a small sample project that shows exactly what I'm trying to do and then I'll post back. Regards, Diego On Monday, April 17, 2017 at 5:59:25 PM UTC-4, mhh...@gmail.com wrote: > > Hi, > > no problem. > > I think you are looking to load multiple package at once,

Re: [go-nuts] Link documentation sources

2017-04-17 Thread Stas Maksimov
I believe this documentation is built from comments in the source code: https://go.googlesource.com/go/+/go1.8.1/src/path/path.go S. On Mon, 17 Apr 2017 at 20:49 anatoly techtonik wrote: > On Monday, April 17, 2017 at 7:35:00 PM UTC+3, Jan Mercl wrote: > >> On Mon, Apr 17, 2017 at 5:45 PM anato

Re: [go-nuts] Link documentation sources

2017-04-17 Thread anatoly techtonik
On Monday, April 17, 2017 at 7:35:00 PM UTC+3, Jan Mercl wrote: > > On Mon, Apr 17, 2017 at 5:45 PM anatoly techtonik > wrote: > > > I want to see documentation sources for this page - > https://golang.org/pkg/path/#pkg-overview > > Why there is no link to them in the footer, like on > https://r

[go-nuts] Re: ast - Missing Ident.Obj

2017-04-17 Thread mhhcbon
Hi, no problem. I think you are looking to load multiple package at once, something that d load import declaration as well, https://godoc.org/golang.org/x/tools/go/loader#Config.FromArgs https://godoc.org/golang.org/x/tools/go/loader#Config.Import https://play.golang.org/p/TzbncKLd7b I think

Re: [go-nuts] Re: memclr optimization and structs

2017-04-17 Thread 'Keith Randall' via golang-nuts
Sorry, my first look at this was incorrect. Changing the pointer to a scalar does re-enable the optimization. But so does making it less than 4 words in size. The optimization fails because the loop body gets translated to { tmp := Foo{}; testFoo[i] = tmp } by the order pass (cmd/compile/int

[go-nuts] Re: ast - Missing Ident.Obj

2017-04-17 Thread Diego Medina
Sorry, I didn't include enough information, you are right, this is more about the type checker, I have a call to conf.Check(pkg.path, fset, astFiles, &info) that does the typecheck gets the astFiles from the given package (a in this example) , but I didn't find a way to pass multiple packages

[go-nuts] Re: [ANN] Enhanced Markdown template processor(emd): helper to generate README file

2017-04-17 Thread mhhcbon
Hi, some more updates there has been several beta since last time, last one is https://github.com/mh-cbon/emd/releases/tag/0.0.9-beta7 changes - new functions: -*yaml(file string, keypaths ...string)*: parses and build new yaml content of given file. -*preline(pre , content strin

[go-nuts] Re: Yet Another Question About exec.Command and Cmd.StdinPipe

2017-04-17 Thread jkevinm . 66
Usually shell scripts are not callable from language execs. Instead of running "./child.sh", you should probably run "/bin/bash", "./child.sh". On Thursday, August 29, 2013 at 1:33:57 PM UTC-7, Daryl Williams wrote: > > Hi Kyle, Thanks for your reply, and your right, I was just using bash as

[go-nuts] exec.Command using network conn for stdin, stdout

2017-04-17 Thread Kevin Johnson
Hi, Since golang is so awesome in it's network abilities, I wrote a simple inetd super server, but my network connections come encrypted with SSL, instead of plain-text. This program runs great as it is, my client communicates and send and receives data from the server's exec-ed program, but

[go-nuts] Re: i/o timeout when using bufio on net connection (tcp)

2017-04-17 Thread Kevin Johnson
Hi Vasiliy, I spent a few minutes looking at your program and a couple things jumped out at me. As you are probably aware, writes on a network socket usually return the number of bytes written, This is because if the TCP buffer fills, then the write call will return only the amount that got a

[go-nuts] Re: Building with "go install" vs "go build"

2017-04-17 Thread Dmitri Shuralyov
> > Are there more that I'm unaware of? > go get. It downloads source and follows it up with go install. Are some preferred in certain circumstances > The three ways you listed are similar but not equivalent, they have subtle differences in behavior. Use whatever is a better fit for your needs

[go-nuts] Re: ast - Missing Ident.Obj

2017-04-17 Thread mhhcbon
Can you clarify your expectation about ast ? in my very humble understanding, Obj is for type checker more than ast. I re call when i worked with it, i had to hide it when i wanted to visualize the tree I even created a gist, https://gist.github.com/mh-cbon/3ed5d9c39e9635cfed0f89698133 to use

Re: [go-nuts] Link documentation sources

2017-04-17 Thread Jan Mercl
On Mon, Apr 17, 2017 at 5:45 PM anatoly techtonik wrote: > I want to see documentation sources for this page - https://golang.org/pkg/path/#pkg-overview > Why there is no link to them in the footer, like on https://readthedocs.org/? What do you mean by 'documentation sources'? -- -j -- You r

[go-nuts] Re: os.Getwd() on windows changes drive letter casing

2017-04-17 Thread peterGo
Andreas, Why do you care? Naming Files, Paths, and Namespaces https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247.aspx "Do not assume case sensitivity. For example, consider the names OSCAR, Oscar, and oscar to be the same." Peter On Monday, April 17, 2017 at 3:06:50 PM UTC, And

[go-nuts] Link documentation sources

2017-04-17 Thread anatoly techtonik
I want to see documentation sources for this page - https://golang.org/pkg/path/#pkg-overview Why there is no link to them in the footer, like on https://readthedocs.org/? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

[go-nuts] myitcv.io/react - GopherJS bindings for React

2017-04-17 Thread Paul Jolly
myitcv.io/react is a package of GopherJS bindings for Facebook's React , a Javascript library for building interactive user interfaces. I've also put together a blog post that explains how to get started with your first

[go-nuts] os.Getwd() on windows changes drive letter casing

2017-04-17 Thread Andreas Reuterberg
I'm calling os.Getwd() as part of a very simple test, but I get different responses depending on if I'm executing the test as a binary or not. The windows drive is upper case when executing the test as a binary even when GOPATH uses a lower case drive. package main import ( "fmt" "os" "testing

[go-nuts] golang.org/x/oauth2 `expires_in` if of type int32, causing `PasswordCredentialsToken` to fail

2017-04-17 Thread denizs247
=== Go version 1.8.1 darwin/amd64 === Hi guys, I recently picked up go and started a small API Client project as a learning project. Having implemented some initial functionality like fetching a user and wanting to try it out, I wrote a small routine which calls the `PasswordCredentialsToken`

[go-nuts] i/o timeout when using bufio on net connection (tcp)

2017-04-17 Thread Vasiliy Tolstov
Hi! I have some client-server app, that uses tcp to connect to remote server. After connection established i'm try to download/upload 21G file (download/upload in the same time so after recieve 26K data i'm send it to remote server) after 700-900Mb i have i/o timeout errors: dst write tcp [2a04:ac

[go-nuts] ast - Missing Ident.Obj

2017-04-17 Thread Diego Medina
Hi, I'm using go/ast (and token/types. etc) to parse a Go project, it all works well when my program only has one package, but there are times where I have code like this: file-a.go = package a ... selector := b.Selector(CompanyID) ... and then file-b.go package b

Re: [go-nuts] Re: golang tour - floating point numbers

2017-04-17 Thread ksampath
thanks all.. end of the day simple silly one .. went unnoticed .. On Sunday, April 16, 2017 at 11:53:11 PM UTC+5:30, Janne Snabb wrote: > > It does not do this. > > It would be nice in most cases if it did. > > But some times extra parenthesis are useful for making some formula > easier to read

[go-nuts] Re: Best practice for client API with both context-aware and non-context-aware methods

2017-04-17 Thread Jonathan Hall
Thank you, everyone, for the feedback. You've validated my thoughts on the matter. I just removed all of the non-Context methods from my library, and am much happier with it already. Cheers. On Saturday, April 15, 2017 at 2:49:55 AM UTC+2, Jonathan Hall wrote: > > I'm working on a client clien

[go-nuts] [ANN] mastodon API client

2017-04-17 Thread mattn
Hi list. I'm writing API client for mastodon from few days ago. https://github.com/mattn/go-mastodon Currently, all of APIs which is written in documentation of mastodon have already been implemented. And using context package. Also include command line app. Thanks. -- You received this mes

[go-nuts] on gorm internals

2017-04-17 Thread dc0d
Why in *gorm* source, callbacks get called via *CallMethod,* using *reflection*? And not by casting to an *interface* that has a callback method (say AfterFind)? I like to learn about the reasoning & it's implications. -- You received this message because you are subscribed to the Google Group