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

2016-08-15 Thread Dave Cheney
w2 | wc -l > 257 > > Don't know that this is very telling. > > Is there another important metric as far as go compilation? Or another > compiler option to see numbers branches or the like which could point up > something? > > > On Monday, August 15, 2016 at 1:40:

[go-nuts] How to wait for http.ListenAndServeTLS()

2016-08-15 Thread Dave Cheney
Listen and serve is just a wrapper around serve with a provided listener. Create the listener then pass it to serve, at that point you know the socket is open and will accept connections into its backlog. -- You received this message because you are subscribed to the Google Groups

[go-nuts] How to wait for http.ListenAndServeTLS()

2016-08-15 Thread Dave Cheney
Alternatively, make a connection to your server locally to check it is listening, the fire off the browser. -- 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] Understanding go routine heap

2016-08-20 Thread Dave Cheney
I haven't run the code under the race detector (hint, do this and you'll have the official answer) but I don't believe wg.Wait creates a happens before event that ensures the assignment to result will be visible to other goroutine. -- You received this message because you are subscribed to

Re: [go-nuts] Remove vs Delete

2016-08-20 Thread Dave Cheney
Additionally in unix, where the name comes from, a file may have many names (many hard links to a directory entry) so remove in this case is removing a directory entry. Separately, when the link count of a file drops to zero, the file is now inaccessible as you cannot link to something that

Re: [go-nuts] cmd.Exec over TCP

2017-02-25 Thread Dave Cheney
On Sunday, 26 February 2017 16:54:25 UTC+11, Oleg Puchinin wrote: > > Hello ! > What is wrong and how to do it ? > What did you expect to happen? What happened instead? > > func handleconnection(tcp net.Conn) { > cmd := exec.Command("/bin/bash") > cmd.Stdin = tcp > cmd.Stdout =

[go-nuts] Re: why the second memory allocation is blocked?

2017-03-01 Thread Dave Cheney
Yup. A syscall causes the scheduler to create a new thread that replaces the one blocking on the syscall. -- 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: why the second memory allocation is blocked?

2017-03-01 Thread Dave Cheney
Your spinning goroutine is block the garbage collector which needs to stop, temporarily, all the running goroutines to make love objects. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails

Re: [go-nuts] Re: why the second memory allocation is blocked?

2017-03-02 Thread Dave Cheney
The oscar for worst autocorrect in a technical debate goes too ... On Thursday, 2 March 2017 21:04:16 UTC+11, Michael Jones wrote: > > Go deserves a keyword to "make love objects." > > On Thu, Mar 2, 2017 at 9:47 AM Dave Cheney <da...@cheney.net > > wrote: > &

[go-nuts] reflect.ValueOf thread safety

2017-02-27 Thread Dave Cheney
No, that's is not thread safe. The race detector will spot that. -- 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

Re: [go-nuts] In the future, how to keep runtime.KeepAlive from dead code elimination?

2016-08-25 Thread Dave Cheney
Not really. Runtime.KeepAlive is special, it'll continue to be special in the future. -- 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: unsupported GOOS/GOARCH pair darwin/x86_64 on mac installed from package

2016-08-31 Thread Dave Cheney
It looks like they've exported GOARCH=x86_64 which is the linux preferred word for amd64. They should either remove the GOARCH setting or set it to GOARCH=amd64 On Thursday, 1 September 2016 10:19:35 UTC+10, kortschak wrote: > > One of my users has struck a problem with an install of go1.7 from

[go-nuts] Re: [golang-dev] help me with gorutines

2016-09-05 Thread Dave Cheney
Please redirect this question to golang-nuts. On Sun, Sep 4, 2016 at 7:22 AM, Ринат Галиев wrote: > Hi, i need to solve the task: > Change the program so that the numbers 1 through 6 were printed to the > console in order. Allowed to amend the sections of code that are

[go-nuts] Re: memory leak with websocket service based on go-socket.io

2016-09-06 Thread Dave Cheney
Are you sure that goroutines are exiting? You can check this in the /debug/pprof handler. It will tell you how many goroutines are currently running. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

[go-nuts] Re: memory leak with websocket service based on go-socket.io

2016-09-06 Thread Dave Cheney
t; > > 在 2016年9月6日星期二 UTC+8下午4:25:40,Dave Cheney写道: >> >> This error handling looks wrong, >> >> >> https://gist.github.com/aiden0z/b8cf00953e81f778bd584fa2ff7eaae7#file-server-go-L268 >> >> Any error from socketio is ignored, and the method alwa

[go-nuts] Re: memory leak with websocket service based on go-socket.io

2016-09-06 Thread Dave Cheney
me.goexit took so many memory. > > > 在 2016年9月6日星期二 UTC+8上午11:07:42,Dave Cheney写道: >> >> It looks like your application is using 4.5gb of ram. Check the number of >> sockets and goroutines you have running. If there are no timeouts then the >> goroutines

[go-nuts] What 'select' is doing here?

2016-09-06 Thread Dave Cheney
Here's the same program rewritten. https://play.golang.org/p/ANHNUcPjR2 If ch is writable, then select pseudo randomly chooses the first or second case. The default case is never taken unless ch is blocked, in which case the goroutine will block sending to ch indefinitely. -- You received

[go-nuts] Re: memory leak with websocket service based on go-socket.io

2016-09-06 Thread Dave Cheney
Also, heap released will not grow until you stop the memory leak and enough of the heap remains idle for more than 10 minutes. -- 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,

[go-nuts] Re: src/log/log.go: What makes it expensive in this code of log.go?

2016-09-06 Thread Dave Cheney
The log package has some benchmarks, maybe make the change and see if it makes a difference. On Wednesday, 7 September 2016 02:46:09 UTC+10, mwor...@gmail.com wrote: > > Hey, It's commented "release lock while getting caller info - it's > expensive" in source code of /src/log/log.go line:150. >

Re: [go-nuts] go doc defaults to use a pager?

2016-09-01 Thread Dave Cheney
function godoc { ${GOBIN:-${GOROOT}/bin}/godoc $@ | ${PAGER:-less} } On Friday, 2 September 2016 10:40:42 UTC+10, anatoly techtonik wrote: > > And why is that? Is it because it is impossible to reliably detect > interactive user session? > > On Thursday, February 16, 2012 at 1:25:28 AM

Re: [go-nuts] labeled loop vs for statement inlining

2016-08-30 Thread Dave Cheney
Inlining is conservative. As well as the size of the code being inlined, current 40 units (unit has not scale), some operations are not inlined, as they are considered hairy. switch used to be considered hairy, 1.7 fixed that, for is still hairy. On Tuesday, 30 August 2016 15:58:30 UTC+10,

[go-nuts] Close a reader to quit a loop without closing its source

2016-08-31 Thread Dave Cheney
Unfortunately POSIX does not guarantee that close from one thread will unblock another. -- 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] What 5 things does Go need in 2017?

2016-09-12 Thread Dave Cheney
Sep 2016, at 19:41, Russel Winder <rus...@winder.org.uk> wrote: > >> On Mon, 2016-09-12 at 17:21 +1000, Dave Cheney wrote: >> Distros are always out of date, sometimes hilariously. Official in my >> parlance means "from the go team" > > If the o

[go-nuts] Re: Best practices for upgrading go with existing GOPATH?

2016-09-14 Thread Dave Cheney
I'm sorry to hear that you're having issues. The Go tool should detect that a cached package in $GOPATH/pkg is out of date and overwrite it. If this is not happening reliably this may be a bug. Can you give some details about what you tried, what you expected to happen and what happened

Re: [go-nuts] support for mips32

2016-09-10 Thread Dave Cheney
A mips32 port is in the works, https://groups.google.com/forum/#!topic/golang-dev/GDtW0vCretE On Saturday, 10 September 2016 18:33:11 UTC+10, ff...@gmx.us wrote: > > > > Le lundi 21 décembre 2015 19:01:25 UTC+1, Manlio Perillo a écrit : >> >> ... >> Only arm and mingw toolchains are available,

Re: [go-nuts] Assigning +Inf to a float32 ..

2016-09-11 Thread Dave Cheney
https://play.golang.org/p/RthMnILvkP func main() { inf := float32(math.Inf(+1)) fmt.Println(inf) } On Sunday, 11 September 2016 15:58:04 UTC+10, bradfitz wrote: > > Not beautiful, but... > > https://play.golang.org/p/WWEEJN8LcF > > func main() { > i32 := math.Float32frombits(0x7F80) >

[go-nuts] Re: memory leak with websocket

2016-09-13 Thread Dave Cheney
I'm glad you found the cause of the leak. -- 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] parsing millisecond coming after colon

2016-09-12 Thread Dave Cheney
You're ignoring the error from time.Parse, that will tell you what went wrong. -- 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: Oops ! i thought 'go' would be an easy to use programming language like BASIC or Scratch ( ! )

2016-09-12 Thread Dave Cheney
I'm sorry you've not enjoyed Go. How to uninstall Go will depend on how you installed it. I'll give tree options, if they do not apply, please reply with more detail about how you installed Go. 1. If you installed Go via homebrew, which is quite common, use the brew command to uninstall Go 2.

[go-nuts] Re: Best practices for upgrading go with existing GOPATH?

2016-09-15 Thread Dave Cheney
I don't think it's about the installation of the tools. The problem you've described sounds like you have tools that use the compiled form of the package, but your development process has not embraced go install so what you go build the later test is not the same thing. -- You received this

[go-nuts] On Concurrent-Safety

2016-09-13 Thread Dave Cheney
It depends who can see that variable, if this is a global variable, or its address has been taken it is not safe. If the variable is private the goroutine then it is safe becase there is no race on private variables. Remember a variable of type chan is just a pointer. -- You received this

[go-nuts] Re: SimpleHttpServer built into go toolchain?

2016-09-29 Thread Dave Cheney
> Since Go is battery included and http is part of its core library, We said batteries, not the kitchen sink. But seriously, the standard library gives you the components to build these tools yourself. If the Go distro included a http server that just served static files, while this would be

Re: [go-nuts] Single instance of program

2016-10-05 Thread Dave Cheney
Stick an @ at the start of the file name, or the socket will remain on disk after the process has exited. -- 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] Single instance of program

2016-10-05 Thread Dave Cheney
It's a Linux thing, Google abstract domain socket. -- 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] Single instance of program

2016-10-04 Thread Dave Cheney
wide. One of values that it returns identifies > that if the mutex is already created by other instance, or it's the first > time it's being created on this system. > > Is there something similar on Linux? > > On Tuesday, July 19, 2011 at 3:55:45 PM UTC+4:30, Dave Cheney wrote: >

[go-nuts] Re: overriding keywords or rather allowing them to be part of a struct in go?

2016-10-04 Thread Dave Cheney
bt, to serialise a structure with encoding/json or encoding/xml (and anything else which uses reflect) the fields have to be public (start with a capital letter) anyway, so that breaks the deadlock with keywords of the same name. On Wednesday, 5 October 2016 02:54:32 UTC+11, David Luu

[go-nuts] go1.4.2/go/pkg/tool/linux_386/8g: signal: segmentation fault

2016-09-21 Thread Dave Cheney
Centos 5 is not supported, the kernel is too old. Sorry. -- 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

Re: [go-nuts] Re: The site at localhost:1234 can't be reached.

2016-09-17 Thread Dave Cheney
Yes. The bottom. -- 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: Best practices for upgrading go with existing GOPATH?

2016-09-15 Thread Dave Cheney
ok, that sounds like a different problem. Some tools use the cached (.a file in the pkg/ directory) version others use the src directly. If you don't install, the tools that use the .a version will be out of date (at best) or fail (at worse). Really, you want to use go install, just trust me

[go-nuts] Re: The site at localhost:1234 can't be reached.

2016-09-17 Thread Dave Cheney
Move http.ListenAndServe to the top of the main() function, outside the http.HandleFunc call and it will work. On Sunday, 18 September 2016 05:50:03 UTC+10, loc...@gmail.com wrote: > > Hello everyone, > > I am using Go version 1.7.1 on a 32-bit version of Windows 10 and cannot > view the

[go-nuts] Randomizing contents of a file

2016-09-20 Thread Dave Cheney
Break breaks out of the select, not the for. Return would work here, or you could use a labled break. -- 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] write in file the result of code

2016-09-19 Thread Dave Cheney
What did you expect to happen when you ran this program? What happened instead? -- 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] SQL database connection

2016-09-19 Thread Dave Cheney
What did you expect to see when you ran that code? What did you see instead? -- 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: memory profiler for benchmark test reports 0s across the board

2016-09-20 Thread Dave Cheney
int > where I'm not expecting it, which is preventing capture of a good profile. > > On Monday, September 19, 2016 at 5:18:56 PM UTC-5, Dave Cheney wrote: >> >> Try b.ReportAllocs() before your benchmark loop. That's the easiest way >> to benchmark the allocations per

[go-nuts] Re: write in file the result of code

2016-09-19 Thread Dave Cheney
I'm sorry this did not fix your problem. Can you please try to explain your problem, I don't think I understand what the issue you are having is. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

[go-nuts] memory profiler for benchmark test reports 0s across the board

2016-09-19 Thread Dave Cheney
Try b.ReportAllocs() before your benchmark loop. That's the easiest way to benchmark the allocations per operation. -- 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] Re: Panic when calling fmt.Printnl() on string (segmentation violation)

2016-08-25 Thread Dave Cheney
Whenever you suspect memory corruption, try the race detector. Can you also please post the full panic message, you cut off the important part On Friday, 26 August 2016 01:11:49 UTC+10, arb...@gmail.com wrote: > > Hello everyone, > > My application occasionally crash when processing string

Re: [go-nuts] In the future, how to keep runtime.KeepAlive from dead code elimination?

2016-08-26 Thread Dave Cheney
runtime/mfinal.go:464 On Friday, 26 August 2016 19:56:49 UTC+10, Cholerae Hu wrote: > > I'm curious that how does compiler recognize runtime.KeepAlive specially? > > 在 2016年8月26日星期五 UTC+8上午12:04:57,Ian Lance Taylor写道: >> >> On Thu, Aug 25, 2016 at 12:15 AM, Cholerae Hu >>

Re: [go-nuts] ListenAndServe without alert

2016-08-24 Thread Dave Cheney
Try listening on 127.0.0.1 not localhost, on osx at least this avoids the alert because it avoids the DNS lookup. -- 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] go analysis memory mallocs

2016-09-29 Thread Dave Cheney
Be careful that the compiler isnt removing some or all of your program. Check the asm to assert that your program is not being optimised away. Then check -gcflags=-m to see if the compiler is choosing a different escape analysis depending on the size of your allocation. -- You received this

[go-nuts] Re: go compile for memory allocation

2016-09-29 Thread Dave Cheney
Don't forget to log that 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 options, visit

Re: [go-nuts] Re: do packages need to be recompiled when Go is upgraded?

2016-09-28 Thread Dave Cheney
s/go build/go install/g On Thursday, 29 September 2016 01:41:31 UTC+10, Micky wrote: > > go list ... > go build ... > > It will build only if it it needs to! Otherwise add -a to force. > > On Wed, Sep 28, 2016 at 8:30 PM, Tim K > wrote: > >> OK, so all that should happen is

Re: [go-nuts] why this?

2016-09-29 Thread Dave Cheney
Sorry, I misspoke, this logic does not apply to map lookup, they are unrelated other than having a one arg and two arg form. -- 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

Re: [go-nuts] why this?

2016-09-29 Thread Dave Cheney
Which of these would you prefer happened instead? * A failed type assertion always panic'd * A failed type assertion never panic'd and instead returned the zero value, as the map lookup does * Something else Dave -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] why this?

2016-09-29 Thread Dave Cheney
If you think that's inconsistent, you should see how we used to delete things from maps ;) -- 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] why this?

2016-09-29 Thread Dave Cheney
It's all in the release history, this change occured before Go 1.0. -- 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

Re: [go-nuts] why this?

2016-09-29 Thread Dave Cheney
That sounds like a very bad idea. You type assert to the wrong type and receive a valid blank value for that type. If you're lucky the program crahesh immedialy because the type's zero value is nil, if you're not the person program continues to execute using this types zero value for an unknown

[go-nuts] glog log rotate not working correctly

2016-09-29 Thread Dave Cheney
This is usually caused by the process writing to a log file that has been deleted. This is a very common bug with programs that rotate their own logs and a major reason why 12 factor apps recommend that log rotation be down by an external program. Have a look in /proc/yourprocess/fd with ls

[go-nuts] Re: go analysis memory mallocs

2016-09-29 Thread Dave Cheney
One way to do this might be to enable memory profiling in your program with the rate set to 1. Hopefully this will record the stack trace of every allocation. The data may need some interpretation -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] why this?

2016-09-29 Thread Dave Cheney
king > v := iface.(someType) > semantically equivalent to > v, _ := iface.(someType) > 'cause I don't see any. > > On Thu, Sep 29, 2016 at 11:40 AM, Dave Cheney <d...@cheney.net> wrote: > >> A type assertion is dangerous because if the thing you are asserting to >> doesn't

[go-nuts] Re: go analysis memory mallocs

2016-09-29 Thread Dave Cheney
Sorry, you'll have to work harder to generate a memory profile. My github.com/pkg/profile package may help automate some of the work, but may introduce a few allocations of its own which you will have to filter out. -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] Re: go escape analysis

2016-09-29 Thread Dave Cheney
-gcflags=-m is your guide. There are no documents of the escape analysis done by the gc compiler, but you could read the source of cmd/compile/internal/gc/esc.go -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group

Re: [go-nuts] why this?

2016-09-29 Thread Dave Cheney
wrote: > On Thu, Sep 29, 2016 at 9:31 AM, Dave Cheney <d...@cheney.net> wrote: > >> Sorry, I misspoke, this logic does not apply to map lookup > > > But why? It seems to me, everything you said can just as easily be applied > to map lookups. Why is a zero-value on a ty

[go-nuts] Re: go escape analysis

2016-09-28 Thread Dave Cheney
Which version of Go? On Thursday, 29 September 2016 00:18:29 UTC+10, 刘桂祥 wrote: > > // example1.go > package main > > > func main() { > > for i := 0; i < 2; i++ { > m := make(map[int]int) >

[go-nuts] Re: about interface data pointer

2016-10-02 Thread Dave Cheney
r(uintptr(Pointer()) + 8 > } > > and add debug info to runtime/mallocgc.go file > here is the output: > > debug > mallocgc: 8 > mallocgc return2: 0xc20800a220 > 0xc208039f68 (0xa00a0,0xc20800a220) > mallocgc: 3 > mallocgc return2: 0xc20800a230 > debug1 100 0xc208039f

[go-nuts] Re: glog log rotate not working correctly

2016-09-29 Thread Dave Cheney
Did you find the open deleted file in /proc/.../fds ? On Thursday, 29 September 2016 22:37:47 UTC+10, ramkumar.g...@gmail.com wrote: > > So it looks like a bug in the glog library. Anyway to file a bug against > it? -- You received this message because you are subscribed to the Google Groups

[go-nuts] CPU Profiling on Mac OS Sierra

2016-11-08 Thread Dave Cheney
http://talks.godoc.org/github.com/davecheney/high-performance-go-workshop/high-performance-go-workshop.slide#36 See also think linked issue at the bottom of the slide. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

Re: [go-nuts] Are short variable declarations necessary?

2016-11-09 Thread Dave Cheney
There are already too many ways to declare and or assign a variable in Go. Adding more is not a solution. -- 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] My Computer compiles go slower than my friends worse laptop

2016-11-06 Thread Dave Cheney
What is the exact command you and your friend are using to build your project? -- 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: My Computer compiles go slower than my friends worse laptop

2016-11-06 Thread Dave Cheney
-build On Monday, 7 November 2016 05:12:55 UTC+11, gkol...@gmail.com wrote: > > go build main.go > > On Sunday, November 6, 2016 at 1:21:24 AM UTC-5, Dave Cheney wrote: >> >> What is the exact command you and your friend are using to build your >> project? > > -

Re: [go-nuts] Are short variable declarations necessary?

2016-11-09 Thread Dave Cheney
and function/method parameters, and named return arguments. On Wednesday, 9 November 2016 23:13:36 UTC+11, Jan Mercl wrote: > > On Wed, Nov 9, 2016 at 1:00 PM T L > wrote: > > > many? I see only two ones. > > v := expr > var v = expr > var v T > var v T = expr > > -- > > -j

[go-nuts] Re: Why google cloud vision api cause memory issue when it is failed to detect

2016-11-09 Thread Dave Cheney
Can you please post the full stack trace of the crash and a piece of code to reproduce the issue. Thanks. On Thursday, 10 November 2016 00:26:03 UTC+11, nova...@gmail.com wrote: > > Hi i am using Google Cloud vision API in my server side (JAVA) but when no > results found my server got crashed

[go-nuts] Re: Garbage collector

2016-11-09 Thread Dave Cheney
The garbage collector only runs when your program creates garbage -- the more your program allocates, the harder the garbage collector will work. On Thursday, 10 November 2016 15:31:24 UTC+11, vyasgir...@gmail.com wrote: > > Is there a way to overwork the garbage collector in go lang? > --

[go-nuts] question on profiling and instruction count display

2016-11-10 Thread Dave Cheney
I'm afraid not, pprof does not record that information. -- 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: Concurrency and order of execution

2016-11-10 Thread Dave Cheney
The runtime does not give any guarentee when you use a go statement if the goroutine being spawned will run immediately, or if control will remain with the original goroutine. This program, https://play.golang.org/p/-OcCzgt4Jy, which pauses all goroutines while they are being created exhibits

[go-nuts] Re: Sub-Benchmark strange results.

2016-11-10 Thread Dave Cheney
Can you post a runable sample so that other can try to reproduce your issue? On Friday, 11 November 2016 12:06:21 UTC+11, Evan Digby wrote: > > Is it expected that if multiple sub-benchmarks are run in the same > benchmark, the cost of the setup will impact the results from the first >

[go-nuts] OS thread leak on ARM

2016-11-04 Thread Dave Cheney
Are you able to post a piece of sampl code which reproduces the problem? -- 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: My Computer compiles go slower than my friends worse laptop

2016-11-06 Thread Dave Cheney
Yup, totally av. To demonstrate this, use the -x flag, that will show you, just by the named eye, which commands are being delayed by your av software. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

[go-nuts] Re: Golang should have a center packages index hosting like npm, rust crates

2016-10-20 Thread Dave Cheney
For some background, I'm trying to flesh out the concerns of the various personas who would interact with a central repository. https://docs.google.com/document/d/10jbJLkmQgpi1CxHKuO75Av1tKYgtOBSjzX5Z9hnG0vI/edit?usp=sharing On Thursday, 20 October 2016 17:43:08 UTC+9, Dave Cheney wrote: >

[go-nuts] Re: Golang should have a center packages index hosting like npm, rust crates

2016-10-20 Thread Dave Cheney
T L, I often hear this comment when a central repo for Go is proposed/suggested/requested. Are you able to give details of the things you do not like about Maven/npm/rubygems central repos. The most specific the better please. On Thursday, 20 October 2016 16:23:09 UTC+9, T L wrote: > > > > On

Re: [go-nuts] What is called reference values in Golang?

2016-10-20 Thread Dave Cheney
What is a pointer wrapper value? in all seriousness, if you review the git history of the Go spec you'll find the word "reference" was purged about two years ago, in effect, to try to stem these discussions. On Thursday, 20 October 2016 16:07:07 UTC+9, T L wrote: > > > > On Thursday, October

[go-nuts] Re: ARM server board

2016-10-23 Thread Dave Cheney
There are no server class arm64 boards in your price range, sorry. If you want server class hardware you should look to Cavium or ARM themselves, these development systems start at the several thousand US dollar price range. If you want something in the $400 mark, http://www.96boards.org/

Re: [go-nuts] Re: ARM server board

2016-10-23 Thread Dave Cheney
If you want to do power comparisons you should probably do an apples to apples comparison. Just like you wouldn't deploy your app on an Intel netbook powered by an ancient celeron, you wouldn't deploy your app on a consumer level odroid development board. It's also important to remember that

[go-nuts] Re: Cross-compile Go code from a x86_64 host to an Arm system (Raspberry Pi 3)

2016-10-23 Thread Dave Cheney
Yes, http://dave.cheney.net/2015/08/22/cross-compilation-with-go-1-5 On Monday, 24 October 2016 02:08:07 UTC+11, Carlos Ferreira wrote: > > Is there a way to cross-compile Go Code to an arm platform, for example, a > Raspberry Pi 3? > > -- You received this message because you are subscribed

Re: [go-nuts] Re: ARM server board

2016-10-23 Thread Dave Cheney
running arm64 mode at the moment. This is a limitation of the kernel as shipped by the Raspberry Pi foundation. > > Ibrahim, no, I want to play with ARM. I have many intel boards. > > Thanks > dharani > > On Sat, Oct 22, 2016 at 11:46 PM, Dave Cheney <da...@cheney.ne

Re: [go-nuts] Re: ARM server board

2016-10-23 Thread Dave Cheney
re 32 bit systems with a 2G/2G user/kernel address space split. > > Thanks > dharani > > On Sat, Oct 22, 2016 at 11:46 PM, Dave Cheney <da...@cheney.net > > wrote: > >> There are no server class arm64 boards in your price range, sorry. >> >

[go-nuts] Is os.exec thread safe ?

2016-10-25 Thread Dave Cheney
os.Exec is thread safe. -- 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: Is it possible to enable http2 and have specific TLS configuration?

2016-10-25 Thread Dave Cheney
You have to depend on golang.org/x/net/http2 to opt in https://github.com/davecheney/httpstat/blob/master/main.go#L252 On Wednesday, 26 October 2016 03:46:31 UTC+11, Moshe Litvin wrote: > > The code in net/http/transport.go (onceSetNextProtoDefaults) contain: > > if t.TLSClientConfig != nil ||

[go-nuts] Re: cross-compile with cgo 'permission denied'

2016-10-25 Thread Dave Cheney
Unless you have built Go from source and/or your user owns the path Go is installed in, this is one of the few cases where go build is recommended over go install. http://dave.cheney.net/2015/08/22/cross-compilation-with-go-1-5 On Wednesday, 26 October 2016 05:09:18 UTC+11, Liam wrote: > > I

[go-nuts] Re: Sub-Benchmark strange results.

2016-11-14 Thread Dave Cheney
Cool. Thanks for figuring it out and posting your answer. On Tuesday, 15 November 2016 07:28:16 UTC+11, Evan Digby wrote: > > Confirmed bug on my part. > > When using the "..." suffix to pass a slice into a func with variadic args > it passes through the the original slice, rather than

[go-nuts] Re: multiple write headers problem

2016-11-23 Thread Dave Cheney
I think you problem is here jsonReservations, err := jsonConvert.ReservationsJson(otherReservations) if err != nil { rw.WriteHeader(http.StatusExpectationFailed) fmt.Println(err) } Instead try this if err != nil {

Re: [go-nuts] Do Go Routines use continuations to allow yelding?

2016-11-25 Thread Dave Cheney
On Saturday, 26 November 2016 08:00:24 UTC+11, Roger Alsing wrote: > > So it works very similar to normal OS thread context switching, but more > explicit? > Yes, goroutine switching occurs a known points; effectively where the goroutine is blocked from proceeding; sending and receiving on

[go-nuts] Re: Error Handling

2016-11-25 Thread Dave Cheney
Would a type switch do what you want ? err := fn() switch err := err.(type) { case nil: // all good case *MyCustomError: // do something custom default: // unexpected error } On Saturday, 26 November 2016 05:07:55 UTC+11, Parveen Kumar wrote: > > Hi Team, > > I want to catch my custom

[go-nuts] err variable shadowing — is it a bad practice?

2016-11-23 Thread Dave Cheney
This is extremely common in go code, vet is being pedantic, -- 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: Interface vs first-class function

2016-11-21 Thread Dave Cheney
With a nod to Chris's excellent presentation, this may be an example of Go breaking its own orthogonality rules for the sake of being more consistent (the rule of least surprise) There is a strong overlap between an interface with a single method and a function value, Tomás Senart spoke about

[go-nuts] Re: Where should interfaces live?

2016-11-21 Thread Dave Cheney
My vote is for "in the package that needs them" On Tuesday, 22 November 2016 02:30:21 UTC+11, Vorn Mom wrote: > > Sorry if it was asked before, but where should interfaces live? > >- In the package that contains an implementation of it. >- In its own package. >- or in the package that

[go-nuts] Re: Why there is a so great performance penalty when the usage combines LockOSThread and channel?

2016-11-22 Thread Dave Cheney
Why do you want to use LockOSthread, you've proved it has a significant performance cost for your application. -- 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: Why there is a so great performance penalty when the usage combines LockOSThread and channel?

2016-11-22 Thread Dave Cheney
Please try profiling your application, if you are on Linux perf(1) works very well for tracing user and system time. -- 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] Re: Why there is a so great performance penalty when the usage combines LockOSThread and channel?

2016-11-22 Thread Dave Cheney
Related, you don't need a pointer to a chan, channels are already pointers to the private runtime channel type. -- 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: Reflect Struct Comparison

2016-11-22 Thread Dave Cheney
Please do not reopen to a four year old thread. Instead please start a new thread describing the problem you have, what you tried, and what happened when you tried. Thanks -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

<    1   2   3   4   5   6   7   >