[go-nuts] convert a given time in one Timezone to other TimeZone

2016-08-10 Thread laxman . ece
I was trying to find the solution to get a given time in timezone1 using the time in timezone2. Have solution to get the time in other timezone for current time but did not found a way to get time for a given time. Thanks L V -- You received this message because you are subscribed to the

[go-nuts] [ANN] Leader Election library using Zookeeper

2016-08-10 Thread Rich Youngkin
Hi all, go-leaderelection ( https://github.com/Comcast/go-leaderelection) provides the capability for a set of distributed processes to compete for leadership for a shared resource. It is implemented using Zookeeper for the underlying support. It

[go-nuts] Re: Go 1.7 Release Candidate 6 is released

2016-08-10 Thread David Marceau
when I install from sources straight from git checkout go1.7rc6 go1.7rc6 FAILS on Asus Z97-A-USB31 motherboard with intel i5-4590, "../misc/cgo/testsanitizers" it core dumps and doesn't give me the success message to start using it as the previous go1.7rc[1-4] did. signal: segmentation fault

Re: [go-nuts] compressing long list of short strings

2016-08-11 Thread Egon
On Thursday, 11 August 2016 02:24:49 UTC+3, Alex Flint wrote: > > There are around 2M strings, and their total size is ~6 GB, so an average > of 3k each. > What kind of data? How large is the alphabet? What is the distribution of letters? Examples would be good :) > > I actually looked

[go-nuts] Cron job (2nd monday of every month/ 3rd tuesday of every month)

2016-08-11 Thread kumargv
Hello guys, i am using this cron pkg https://godoc.org/github.com/robfig/cron what i am trying to achieve here is 1) run a job on 2nd friday of every month 2)run a job on 4nd sunday of every month 3)run a job on 1 monday of every month etc Please suggest thanks -- You received

[go-nuts] parse.ParseExpr("var a = 9") returns error "expected operand, found 'var'"

2016-08-11 Thread Jason E. Aten
I'm trying to use parser.ParseExpr. I'm thinking "var a = 9" is a valid expression, but ParseExpr returns an error: // simple.go: package main import ( "fmt" "go/parser" ) func main() { ast0, err := parser.ParseExpr("var a = 9") fmt.Printf("err = %v\n", err)

Re: [go-nuts] http2 questions

2016-08-11 Thread Brad Fitzpatrick
http.Transports shouldn't be created inside short-lived functions. See the docs on https://golang.org/pkg/net/http/#Transport which say: "By default, Transport caches connections for future re-use. This may leave many open connections when accessing many hosts. This behavior can be managed using

[go-nuts] Re: msan failures in Go 1.7 Release Candidate 6

2016-08-11 Thread David Marceau
go env GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/root/SQstuff/Code" GORACE="" GOROOT="/root/SQstuff/go1.7rc6clang" GOTOOLDIR="/root/SQstuff/go1.7rc6clang/pkg/tool/linux_amd64" CC="/usr/bin/clang" GOGCCFLAGS="-fPIC -m64 -pthread

[go-nuts] Re: How to create reusable HTML components using default html/template package

2016-08-11 Thread Matt Silverlock
Have you looked at template blocks? https://golang.org/pkg/html/template/#example_Template_block My approach is to create a map[string]*template.Template that contains each template (base + layout + blocks for that template), with the map key set to the layout name. On Monday, August 8, 2016

Re: [go-nuts] Re: Ideas for a Go interpeter, feedback requested

2016-08-11 Thread Seb Binet
Jason, On Sun, Aug 7, 2016 at 3:42 AM, Jason E. Aten wrote: > I don't know if there is still interest in this project, > there is (but I personally had to put it a bit on the back burner.) but I continue to be interested. Recently I note that Apple's Swift might >

[go-nuts] Re: ANNOUNCE: gini

2016-08-11 Thread Scott Cotton
Hi Markus, Apologies for the delay, been a busy week. Yes we are planning to enter the coming SAT competitions, and we are seeking help/resources from interested parties. Would be great to have a bona-fide team. There are a number of categories of submissions to the SAT competitions, and I

[go-nuts] templating of multiple go pages

2016-08-11 Thread mimshephsltd
Hi go-nuts, I'm a newbie in golang, but after a brief study I've come to love it . Pls l want to develop an app that receives multiple maths inputs graphically & generates multiple results in a new page that l can save in PDF format concurrently & in parallel. How can l achieve this without

[go-nuts] Beego Session store in mysql

2016-08-11 Thread sounthar cs
Hi there, As of now i am using using for E-commerce website with in-memory session. When i restart my program all the session becomes empty (deleted because session stored in program memory). To resolve this i want to use mysql for session storage. I tried to find a example, but i could not.

[go-nuts] Re: msan failures in Go 1.7 Release Candidate 6

2016-08-11 Thread David Marceau
On ArchLinux with a previously gcc built go binary in go1.7rc5: Linux blah 4.6.4-1-ARCH #1 SMP PREEMPT Mon Jul 11 19:12:32 CEST 2016 x86_64 GNU/Linux with the latest: llvm llvm-libs lldb clang clang-tools-extra go env GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux"

[go-nuts] Cron job (2nd monday of every month/ 3rd tuesday of every month)

2016-08-11 Thread Tamás Gulácsi
// The first monday can be 1-7th, the second 8-14th day of the month. c.AddFunc("0 30 * 8-14 * 1", func() { fmt.Println("second monday of every month") }) // The first tuesday can be 1-7th, the second 8-14th, the third 15-22th. c.AddFunc("0 30 * 15-22 * 2", func() { fmt.Println("3rd tuesday of

Re: [go-nuts] Re: Who wants to use Go to process your camera's raw files?

2016-08-11 Thread Jonathan Pittman
A lot of people would love to see that happen, not for the sake of this situation, but for the sake of being able to translate C to Go in moderately large projects and general uses. If you or someone else has a way to do that, then that would be very interesting to see. Having said that, I think

[go-nuts] Re: Go 1.7 Release Candidate 6 is released

2016-08-11 Thread David Marceau
Ok so yes I recently installed clang on this archlinux box. The previous go binaries were built with gcc/g++. So to clarify and save others time: 1)to build using gcc/g++: CC=/usr/bin/gcc CXX=/usr/bin/g++ GOROOT_BOOTSTRAP=/root/go1.7rc5 ./make.bash 2)to build using clang/clang++:

Re: [go-nuts] Re: Who wants to use Go to process your camera's raw files?

2016-08-11 Thread Cristian Măgherușan-Stanciu
I'm not familiar with the process nor with the tools that were used, but I guess there are people on this list who may be able to point you to those. I suppose if it was feasible for something as large and complex as a compiler, it should be much easier for comparatively smaller pieces of

[go-nuts] Function Call Question

2016-08-11 Thread Tamás Gulácsi
You have to manage the name->function map. Use a Register function to hide it. -- 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

Re: [go-nuts] parse.ParseExpr("var a = 9") returns error "expected operand, found 'var'"

2016-08-11 Thread Martin Schnabel
On Do, 2016-08-11 at 03:55 -0700, Jason E. Aten wrote: > I'm trying to use parser.ParseExpr. I'm thinking "var a = 9" is a > valid expression, but ParseExpr returns an error: > hi jason,  a variable declaration is a statement and not an expression. when in question on this matters take a look at

[go-nuts] Re: Who wants to use Go to process your camera's raw files?

2016-08-11 Thread Guy Allard
For how to go about discussion: would a google group work? Or possibly an organization on github? Personally I could go with almost anything. On Wednesday, August 10, 2016 at 11:09:12 PM UTC-4, Jonathan Pittman wrote: > > For some reason I did not get the last 3 updates until this one.

Re: [go-nuts] compressing long list of short strings

2016-08-10 Thread Dan Kortschak
This looks like something that is solved for genomics data. If you are OK with decompressing m strings where m << n then the BGZF addition to gzip would work for you. In brief, BGZF blocks gzip into 64kb chunks which can be indexed. The spec for BGZF is here [1] (section 4 from page 11 on) and

Re: [go-nuts] Re: Who wants to use Go to process your camera's raw files?

2016-08-11 Thread Jonathan Pittman
Maybe not an organization on github, not for just this. I could see a google group, but I am not sure about that either. We have golang-nuts already. On Thu, Aug 11, 2016 at 3:16 PM, Guy Allard wrote: > For how to go about discussion: > > would a google group work? > >

[go-nuts] Usage of x/net/route

2016-08-11 Thread google
Does anyone have a working example how to use the route package on FreeBSD? I could not find any code that uses this package. -- 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] Increase speed of repeated builds

2016-08-11 Thread James Pettyjohn
I have a project which has become fairly large, I simple check of *.go, no _test files (including all modules), it's up to 1300 files. The main module though is 60 files, about 1MB of go source. It is taking to about 20 seconds to compile for a single change in the main module using go 1.6.2

Re: [go-nuts] Increase speed of repeated builds

2016-08-11 Thread Michael Hudson-Doyle
On 12 August 2016 at 15:01, James Pettyjohn wrote: > I have a project which has become fairly large, I simple check of *.go, no > _test files (including all modules), it's up to 1300 files. > > The main module though is 60 files, about 1MB of go source. It is taking to >

[go-nuts] Increase speed of repeated builds

2016-08-11 Thread Dave Cheney
Can you please post some details. -- 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

Re: [go-nuts] go.net/html parsing html tags and getting text

2016-08-11 Thread cubaneric01
Awesome. Thanks. This is the only threat I have seen that answer this kind of question. > -- 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

Re: [go-nuts] Increase speed of repeated builds

2016-08-11 Thread James Pettyjohn
I noticed that in the release notes, I'll try out the RC and see what it gives me. On Thursday, August 11, 2016 at 8:09:55 PM UTC-7, Michael Hudson-Doyle wrote: > > On 12 August 2016 at 15:01, James Pettyjohn > wrote: > > I have a project which has become fairly large, I

[go-nuts] Re: Increase speed of repeated builds

2016-08-11 Thread James Pettyjohn
Maybe I wasn't clear, I am not sure what else to look at in this scenario. Whatever details you have in mind, i.e. which ones are relevant, is what I'm missing. On Thursday, August 11, 2016 at 8:16:38 PM UTC-7, Dave Cheney wrote: > > Can you please post some details. -- You received this

[go-nuts] How to access RegisterFunc when accessing mattn/go-sqlite3 via database/sql?

2016-08-11 Thread krolaw
Hi, I'm using github.com/mattn/go-sqlite3 through database/sql. I want to register a go func with sqlite, for the purposes of converting timestamps from UTC to the current locale of the current user. This would then allow me to GROUP records together depending on which "day" the records

[go-nuts] Decrypting TripleDES (.Net to Golang)

2016-08-11 Thread sc28
I'm receiving a file encrypted with TripleDES by a .Net process. The code they are using is: class TripleDES { private static System.Security.Cryptography.TripleDES CreateDES(string key) { MD5 md5 = new MD5CryptoServiceProvider();

Re: [go-nuts] Why is reflect.ValueOf(nil map).Interface() != nil?

2016-08-09 Thread Ian Lance Taylor
On Tue, Aug 9, 2016 at 9:48 AM, Sam Salisbury wrote: > > The update I suggest is to add the following sentence to the end of the > reflect.Value.IsNil documentation: > >> Likewise, if v was created by calling ValueOf on an initialised >> interface{} value with a nil value

[go-nuts] Re: Initialize Variables in case clause of a switch

2016-08-09 Thread Nate Finch
I actually just tried to do this the other day. Forgot it wasn't possible. Seems like it would make the language more consistent to allow it. As it is, it's rather surprising that it doesn't work. -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] Small complete examples which show the power of Go?

2016-08-10 Thread Rob Pike
It's not really mine. Tom Cargill first showed it to me, but it started with Doug McIlroy and I think it originates from an idea by David Gries. -rob On Thu, Aug 11, 2016 at 2:27 AM, Paul Rosenzweig wrote: > I always liked Rob Pike's concurrent prime seive:

Re: [go-nuts] Small complete examples which show the power of Go?

2016-08-10 Thread Rob Pike
P.S. The version I first saw was of course not in Go, it was in Newsqueak, but the first complete program ever written in Go (not first executed) was the prime sieve in the first draft of the language specification. -rob On Thu, Aug 11, 2016 at 5:56 AM, Rob Pike wrote: > It's

[go-nuts] Re: Who wants to use Go to process your camera's raw files?

2016-08-10 Thread jonathan . gaillard
I would be interested in seeing this happen. On Tuesday, July 26, 2016 at 7:36:31 PM UTC-7, Jonathan Pittman wrote: > > Well me too! I am looking to see what level of interest there is in the > Go community to see this happen. I am also looking for people who are > interested in working on

[go-nuts] Re: Data locality in large slices

2016-08-03 Thread ondrej . kokes
Downgrading to 1.6.3, I'm also getting consistent benchmark results. I'll try 1.7 on my Mac at home later today, to see if it's a 1.7 thing or a Windows thing or...? On Wednesday, 3 August 2016 14:55:20 UTC+1, C Banning wrote: > > PS - that's with Go v1.6. > > On Wednesday, August 3, 2016 at

[go-nuts] Re: Will compiler do optimization here?

2016-08-03 Thread Hotei
Have you tried examining the assembler output? go build -gcflags="-S" program.go if I recall correctly. On Wednesday, August 3, 2016 at 11:27:36 AM UTC-4, T L wrote: > > > I know a string value can be used as []byte if the first parameter if the > builtin copy/append function is a []byte

[go-nuts] Re: Will compiler do optimization here?

2016-08-03 Thread T L
On Wednesday, August 3, 2016 at 11:59:27 PM UTC+8, Hotei wrote: > > Have you tried examining the assembler output? go build -gcflags="-S" > program.go if I recall correctly. > yes, the output is different, looks like optimization is not made here, but I can't make sure. > > > On

Re: [go-nuts] Is there a function in standard lib to convert []T to a []interface{}?

2016-08-03 Thread T L
On Wednesday, August 3, 2016 at 11:46:43 PM UTC+8, Axel Wagner wrote: > > True, but it would still be just the same loop, it wouldn't actually be > significantly faster. And you'd need to put quite some machinery into a > pretty rarely used functionality, which means it also wouldn't be

Re: [go-nuts] Is there a function in standard lib to convert []T to a []interface{}?

2016-08-03 Thread 'Thomas Bushnell, BSG' via golang-nuts
On Wed, Aug 3, 2016 at 7:36 AM T L wrote: > Often, I need converting a []T to []interface{} to use the []interface as > a variable length parameter. > But converting a []T for []interface{} in a for loop is neither clean nor > efficient. > If there was a builtin that did

Re: [go-nuts] Is there a function in standard lib to convert []T to a []interface{}?

2016-08-03 Thread 'Thomas Bushnell, BSG' via golang-nuts
Don't confuse variadic arguments with slice arguments, by the way. On Wed, Aug 3, 2016 at 8:20 AM T L wrote: > > > On Wednesday, August 3, 2016 at 10:53:34 PM UTC+8, Jessta wrote: > >> On 4 Aug 2016 12:36 a.m., "T L" wrote: >> > >> > Often, I need

[go-nuts] Will compiler do optimization here?

2016-08-03 Thread T L
I know a string value can be used as []byte if the first parameter if the builtin copy/append function is a []byte value: > var bs []byte = make([]byte, 10) > copy(bs, "abcde") but if do explicit conversion anyway on the second string value > var bs []byte = make([]byte, 10) > copy(bs,

Re: [go-nuts] protobuf go and pointers

2016-08-03 Thread Ian Lance Taylor
On Wed, Aug 3, 2016 at 8:58 AM, Sankar wrote: > > I have a .proto2 file, like: > > message s { > optional double a = 1; > } > > When I run protoc and generate the .pb.go file, it contains code like: > > type S struct { > A*float64

Re: [go-nuts] protobuf go and pointers

2016-08-03 Thread Sankar P
Thanks for the explanation. It does look much better in proto3. I will see if it will be possible to switch to proto3. 2016-08-03 21:37 GMT+05:30 Ian Lance Taylor : > On Wed, Aug 3, 2016 at 8:58 AM, Sankar wrote: >> >> I have a .proto2 file, like: >>

Re: [go-nuts] Is there a function in standard lib to convert []T to a []interface{}?

2016-08-03 Thread Jesse McNelis
On 4 Aug 2016 12:36 a.m., "T L" wrote: > > Often, I need converting a []T to []interface{} to use the []interface as a variable length parameter. > But converting a []T for []interface{} in a for loop is neither clean nor efficient. > > So is there a function in standard lib

[go-nuts] protobuf go and pointers

2016-08-03 Thread Sankar
Hi I have a .proto2 file, like: message s { optional double a = 1; } When I run protoc and generate the .pb.go file, it contains code like: type S struct { A*float64 `protobuf:"fixed64,1,opt,name=a" json:"a,omitempty"` XXX_unrecognized []byte `json:"-"` } Why is the A field

[go-nuts] Is there a function in standard lib to convert []T to a []interface{}?

2016-08-03 Thread T L
Often, I need converting a []T to []interface{} to use the []interface as a variable length parameter. But converting a []T for []interface{} in a for loop is neither clean nor efficient. So is there a function in standard lib to convert []T to a []interface{}? -- You received this message

Re: [go-nuts] Is there a function in standard lib to convert []T to a []interface{}?

2016-08-03 Thread James Bardin
https://github.com/golang/go/issues/15209 On Wednesday, August 3, 2016 at 11:20:01 AM UTC-4, T L wrote: > > > > On Wednesday, August 3, 2016 at 10:53:34 PM UTC+8, Jessta wrote: >> >> On 4 Aug 2016 12:36 a.m., "T L" wrote: >> > >> > Often, I need converting a []T to

Re: [go-nuts] Is there a function in standard lib to convert []T to a []interface{}?

2016-08-03 Thread 'Axel Wagner' via golang-nuts
You probably don't want to actually call fmt.Println(s...) with s an []interface{}. Just do fmt.Print(s) instead. On Wed, Aug 3, 2016 at 5:20 PM, T L wrote: > > > On Wednesday, August 3, 2016 at 10:53:34 PM UTC+8, Jessta wrote: >> >> On 4 Aug 2016 12:36 a.m., "T L"

Re: [go-nuts] Is there a function in standard lib to convert []T to a []interface{}?

2016-08-03 Thread 'Axel Wagner' via golang-nuts
True, but it would still be just the same loop, it wouldn't actually be significantly faster. And you'd need to put quite some machinery into a pretty rarely used functionality, which means it also wouldn't be cleaner. The thing is, that the memory representation of []T and []J, with J being an

[go-nuts] Why doesn't std lib use the method in this article to make err variables constant?

2016-08-03 Thread T L
http://dave.cheney.net/2016/04/07/constant-errors -- 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,

Re: [go-nuts] rsa.GenerateKey does not return on sepcial bits

2016-08-03 Thread steve wang
done. https://github.com/golang/go/issues/16596 On Thursday, August 4, 2016 at 12:01:55 PM UTC+8, bradfitz wrote: > > Please file a bug. > > > On Wed, Aug 3, 2016 at 8:20 PM, steve wang > wrote: > >> https://play.golang.org/p/gYYUDxj6Z5 >> >> Is this an issue? >> >> --

Re: [go-nuts] Is there a function in standard lib to convert []T to a []interface{}?

2016-08-03 Thread T L
On Thursday, August 4, 2016 at 12:16:37 AM UTC+8, Ian Lance Taylor wrote: > > On Wed, Aug 3, 2016 at 9:12 AM, T L > wrote: > > > > On Wednesday, August 3, 2016 at 11:46:43 PM UTC+8, Axel Wagner wrote: > >> > >> True, but it would still be just the same loop, it wouldn't

[go-nuts] Re: files, readers, byte arrays (slices?), byte buffers and http.requests

2016-08-03 Thread Sri G
Doh. Thanks. I did the setup but didnt click "execute". Revisiting this because its now a bottleneck since it directly impact user experience (how long a request will take to process) and scalability (requests per second a single instance can handle). It wasn't pre-mature optimization, rather

Re: [go-nuts] Is there a function in standard lib to convert []T to a []interface{}?

2016-08-04 Thread Jesse McNelis
On Thu, Aug 4, 2016 at 3:33 PM, T L wrote: > > With some special memory optimizations for slice, I think it is possible to > make efficient conversions from []T to []interface. > For example, we don't need to convert every element in []T to interface{}, > we can just use

[go-nuts] Re: Will compiler do optimization here?

2016-08-03 Thread T L
I surely will use the first version in practice. I just want to make things clear, :) On Thursday, August 4, 2016 at 3:23:11 AM UTC+8, Hotei wrote: > > If you create the source as a byte array by converting it ([]byte("abcde") > then the compiler can NOT optimize it away. However - I don't

[go-nuts] IDE for GOLANG

2016-08-04 Thread Florin Pățan
You can try any IDE from JetBrains and it should support Go. Among debugging and other things, see what the latest release brought to it: http://go-ide.com/releases/0.11.1725/ -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

[go-nuts] rsa.GenerateKey does not return on sepcial bits

2016-08-03 Thread steve wang
https://play.golang.org/p/gYYUDxj6Z5 Is this 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 golang-nuts+unsubscr...@googlegroups.com. For more

[go-nuts] Re: Why doesn't std lib use the method in this article to make err variables constant?

2016-08-03 Thread Dave Cheney
Because we cannot change symbols covered by the Go 1 contract. On Thursday, 4 August 2016 14:20:18 UTC+10, T L wrote: > > http://dave.cheney.net/2016/04/07/constant-errors > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

[go-nuts] Re: files, readers, byte arrays (slices?), byte buffers and http.requests

2016-08-04 Thread Tamás Gulácsi
If md5 is enough at the end, use an io.T eeReader. If not, you need to buffer it, with bytes.Buffer. That can be reused with sync.Pool (don't forget the Reset). For mime, the first 1024 bytes is enough. Read that into a [1024]byte and create a Reader with io.MultiReader. -- You received this

[go-nuts] Re: Will compiler do optimization here?

2016-08-03 Thread Hotei
Looking at the asm it appears that there is a conversion func called in the second version - right before the copy with memmove. Based on this I'd say what happens AFTER the conversion is the same in both version since the destination is the same and the content is the same. The only

Re: [go-nuts] checking for connection error?

2016-08-03 Thread Michael Banzon
Hi Victor, There are no "constant" errors in the sql package if thats what you are looking for. Generally if .Ping() returns an error there is no connection - afaik the error string might give some indication but it is totally up to the driver/database. If you want to sleep and try again later

[go-nuts] Re: How to check that a Go package has not been modified?

2016-08-03 Thread atd...@gmail.com
I'm a bit uneasy about this. Since checksumming is not collision-resistant, I would be careful just relying on this. The goal was to avoid diffing files but I don't know what is the fastest way. In any case, I guess a checksum is not enough to guarantee file integrity (against malice). Maybe

[go-nuts] Re: How to check that a Go package has not been modified?

2016-08-03 Thread Daniel Theophanes
What is the purpose of this? For instance, In govendor the hash of the files, file names, and path is computed and recorded. That way if they are modified it is detected. So yeah, md5 or blake2 would work just fine. On Wednesday, August 3, 2016 at 10:14:53 AM UTC-7, atd...@gmail.com wrote: > >

[go-nuts] Re: Will compiler do optimization here?

2016-08-03 Thread T L
On Thursday, August 4, 2016 at 12:40:41 AM UTC+8, Hotei wrote: > > Looking at the asm it appears that there is a conversion func called in > the second version - right before the copy with memmove. > > Based on this I'd say what happens AFTER the conversion is the same in > both version since

[go-nuts] Re: How to check that a Go package has not been modified?

2016-08-03 Thread atd...@gmail.com
Yes, I suppose that clamping the file size, and the requirement that the package must pass compilation, even md5 shall do. Thanks to the avalanche effect. On Wednesday, August 3, 2016 at 9:36:34 PM UTC+2, Hotei wrote: > > The fact that collisions are possible does not make them "easy to create"

[go-nuts] Re: Go test package names

2016-08-03 Thread Uli Kunitz
Tests are usually included in the package. Testing a package cannot become easier this way and it is the only way to test internal functions, types, variables or constants. However if you have large test files, it may make sense to keep them in a separate repository because go-getting the

[go-nuts] Re: Data locality in large slices

2016-08-03 Thread charraster
Tu cast pola s ktorou pracujes mas v L1/ L2 cache. V momente ked pristupujes k inej casti pola ktora je niekolko megabajtov vzdialena tak procesor musi natiahnut tie udaje z ram do cache. Neviem presne cisla ale trva to zhruba tych 300 strojovych cyklov . Vypadok L2 neviem kolko trva, je to v

[go-nuts] Re: How to check that a Go package has not been modified?

2016-08-03 Thread Hotei
The fact that collisions are possible does not make them "easy to create" especially when you add the compileable requirement. If you're uneasy about md5 you could always use more bits - like SHA1 used by "git" or SHA256 (or larger) if you're really paranoid. On Wednesday, August 3, 2016 at

[go-nuts] Re: Will compiler do optimization here?

2016-08-03 Thread Hotei
If you create the source as a byte array by converting it ([]byte("abcde") then the compiler can NOT optimize it away. However - I don't think it will *use* the capacity information in the source since it's not relevant and it's going to copy the data bytes and length in any case. If you're

Re: [go-nuts] Is there a function in standard lib to convert []T to a []interface{}?

2016-08-03 Thread charraster
On Wednesday, August 3, 2016 at 6:16:37 PM UTC+2, Ian Lance Taylor wrote: > > On Wed, Aug 3, 2016 at 9:12 AM, T L > wrote: > > > > On Wednesday, August 3, 2016 at 11:46:43 PM UTC+8, Axel Wagner wrote: > >> > >> True, but it would still be just the same loop, it wouldn't

[go-nuts] Re: how to apply netutil.LimitListener() to ListenAndServeTLS()'s listener? how to fetch ListenAndServeTLS()'s listener?

2016-08-03 Thread David Marceau
I perused your blog entry you mentioned. It's very interesting and will come in handy in the future. Thank you. I can appreciate your point of view about accepting the fact that currently listeners are not part of the Server and just proceed to produce code and get it done ASAP. My

[go-nuts] Re: How to wait for specified amount of time in a loop without timer overhead

2016-08-04 Thread pi
You mean something like this? func (b *RingBuf) ReadWait(min uint32, timeout time.Duration) bool { if min == 0 { min = 1 } if b.ReadAvail() >= min { return true } if timeout.Nanoseconds() == 0 { return false } const pollPeriod = 100 *

[go-nuts] SetSafe default value in mgo session

2016-08-04 Thread DM
Can someone explain me the difference between the default value of SetSafe() which is {}and SetSafe(nil)? As per the mgo godoc :- If the safe parameter is nil, the session is put in unsafe mode, and writes become fire-and-forget, without

[go-nuts] Re: Namespacing hack using method on empty type

2016-08-04 Thread dc0d
Personally I do that (despite that everyone advocates against it). Just remember your struct should be just "struct{}" and nothing else. This helped me to use shorter & cleaner names for my functions - actually it converts a function pile to a batch of functions). On Wednesday, August 3, 2016

[go-nuts] Re: How to wait for specified amount of time in a loop without timer overhead

2016-08-04 Thread Dave Cheney
I think it would be cheaper to call time.Sleep than spinning on runtime.Gosched. -- 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: Data locality in large slices

2016-08-04 Thread Dave Cheney
I believe rsc once quipped "If it doesn't have to be correct, I can make [this code] very fast". I don't think you can make performance comparisons between two pieces of code if one is incorrect. -- You received this message because you are subscribed to the Google Groups "golang-nuts"

[go-nuts] How to wait for specified amount of time in a loop without timer overhead

2016-08-04 Thread Dave Cheney
If you're going to sleep, does it matter if time.Sleep has a cost? -- 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

[go-nuts] Reject Unknown clients

2016-08-04 Thread Naveen Shivegowda
Is it possible to make http servers listen only on a few source ip's and request from any other source should be rejected? -- 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] Re: building an exe that will embed import in the .exe

2016-08-04 Thread Alain Milicevic
Zdravo Zlatko, I thought that too but after building an .exe and copying/moving it to another comp, it behaved as if it worked but did not generate a file, so i thought the imported package was not embedded in the .exe So after your response i looked more carefully in the code and i noticed a

[go-nuts] Status of golang.org/x/text/currency (github.com/golang/text)?

2016-08-04 Thread Johan Jian An Sim
There is no issue section in this repository to start a discussion. I would like to ask about the status of currency package. There seems to be plan for further development according to the comments (https://github.com/golang/text/blob/master/currency/format.go#L26). Any update on this? I

[go-nuts] Re: Reject Unknown clients

2016-08-04 Thread Hotei
Certainly possible. You can put the whitelisted IPS in a map and use that to filter the incoming requests. On Thursday, August 4, 2016 at 10:17:37 AM UTC-4, Naveen Shivegowda wrote: > > Is it possible to make http servers listen only on a few source ip's and > request from any other source

[go-nuts] Re: how to apply netutil.LimitListener() to ListenAndServeTLS()'s listener? how to fetch ListenAndServeTLS()'s listener?

2016-08-04 Thread Nathan Kerr
I managed to expand ListenAndServeTLS and then apply LimitedListener. My code and process are posted at https://pocketgophers.com/limit-https-listener/ tcpKeepAliveListener ended up being the only code that was copied but not specialized. It would have been nice if it were exported from the

[go-nuts] Re: Generating execution trace diagram for a go program

2016-08-04 Thread ondrej . kokes
This is excellent, really helpful. The -help flag only mentions testing and casual searching only again pops up with info on more testing, I couldn't see anything on actually using it for running a generic binary. Perhaps it would be worth adding this to the documentation? + things like not

[go-nuts] building an exe that will embed import in the .exe

2016-08-03 Thread ov35711
Hi, i have a program that imports a package from github.com/abc... when i build the .exe how can i have the package/dependency included in the .exe ? thanks, Al -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group

[go-nuts] Re: How to get struct of function

2016-08-03 Thread Bruno Luis Panuto Silva
I suggest you also take a look at the Go spec that describes method values: https://golang.org/ref/spec#Method_values It seems to click on what you want to do. Also, take a look at this article from Alex Edwards: http://www.alexedwards.net/blog/organising-database-access more specifically, the

[go-nuts] Re: SWIG: typemap for std::string* arguments in std_string.i?

2016-08-03 Thread s2323
Please give me your typemap. Thanks! -- 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

[go-nuts] Re: how to apply netutil.LimitListener() to ListenAndServeTLS()'s listener? how to fetch ListenAndServeTLS()'s listener?

2016-08-03 Thread Nathan Kerr
Your research revealed the essential lines from ListenAndServeTLS that basically say: 1. create a tls listener 2. have the server serve using that listener The LimitListener example follows this same pattern, just with net.Listener instead of a tls.Listener. A careful reading reveals that

[go-nuts] Re: how to apply netutil.LimitListener() to ListenAndServeTLS()'s listener? how to fetch ListenAndServeTLS()'s listener?

2016-08-03 Thread James Bardin
The issue here in essence is that an http.Server doesn't store a new.Listener to expose, it only operates on one provided to the Serve method. Without changing the api, there's no way to expose a listener in an http.Server in a way that doesn't interfere with the other methods. However, I

Re: [go-nuts] building an exe that will embed import in the .exe

2016-08-03 Thread Zlatko Čalušić
Hello, When you compile go program, all your source and source from all imported packages is compiled together in the same binary (.exe). You don't need to worry about it. That's actually one of the go strengths, no dll hell. On 03.08.2016 07:57, ov35...@gmail.com wrote: Hi, i have a

Re: [go-nuts] Increase speed of repeated builds

2016-08-11 Thread James Pettyjohn
I tried using 1.7rc6, no issues in compilation but finishes only about half a second under 1.6.2. On Thursday, August 11, 2016 at 8:19:12 PM UTC-7, James Pettyjohn wrote: > > I noticed that in the release notes, I'll try out the RC and see what it > gives me. > > On Thursday, August 11, 2016 at

Re: [go-nuts] Simple test runner

2016-08-12 Thread Simon Ritchie
> go test ./... Sorry, I should have said, I already tried that. The problem is, if you have any directories that don't contain any tests, you get complaints. For each directory with no test files, you get a line on stdout containing "?" and "[no test files]". This includes directories that

[go-nuts] Simple test runner

2016-08-12 Thread Simon Ritchie
Is there a simple tool that will search for and run all the tests in a Go project? What I'm looking for is a tool that will start at a given directory and descend recursively through any subdirectories, looking for test files and running them using go test. Under UNIX you can do this using

[go-nuts] Re: Increase speed of repeated builds

2016-08-11 Thread Dave Cheney
You mentioned timing your build with -x, can you please provide those details. -- 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

Re: [go-nuts] Re: Who wants to use Go to process your camera's raw files?

2016-08-12 Thread Peter Herth
As one would want a clean Go library, I think this library should be implemented from scratch in Go - there is also a better chance to get a really good performing library, if it is designed in Go and not in C. One obvious thing is, to do all heavy computations in parallel via goroutines.

Re: [go-nuts] Simple test runner

2016-08-12 Thread Viktor Kojouharov
go test ./... | fgrep -v '[no test files]' that should be perfectly sufficient to you On Friday, August 12, 2016 at 10:28:08 AM UTC+3, Simon Ritchie wrote: > > > go test ./... > > Sorry, I should have said, I already tried that. The problem is, if you > have any directories that don't contain

Re: [go-nuts] Simple test runner

2016-08-12 Thread Dan Kortschak
go test ./... On Thu, 2016-08-11 at 23:22 -0700, Simon Ritchie wrote: > Is there a simple tool that will search for and run all the tests in a Go > project? > > What I'm looking for is a tool that will start at a given directory and > descend recursively through any subdirectories, looking

[go-nuts] Fast ConcurrentCounter without memory sharing

2016-08-14 Thread gaurav
Hi there, Just for heck of it - I am trying to come up with a ConcurrentCounter that does not suffer memory sharing or the cost of mutex lock/unlock. The idea as described in the following Java code snippet is quite straightforward: - Pin every thread to a unique int32 variable. - Put

<    2   3   4   5   6   7   8   9   10   11   >