[go-nuts] Re: set source path in delve

2017-03-31 Thread YZ Xie
I have read help with delve, there is a command sources to show source files, but there exsit a way to change it? gdb can do it 在 2017年4月1日星期六 UTC+8下午12:58:24,YZ Xie写道: > > Hi all, > > I have meet source path problem, > > there exits two question. > 1. when use ls to list source code, it

[go-nuts] set source path in delve

2017-03-31 Thread YZ Xie
Hi all, I have meet source path problem, there exits two question. 1. when use ls to list source code, it prompts no source available, how to spefic a source folder? in gdb, use directory command to add source search path, can dlv do it ? 2.when I set a breakpoints on function main, I know

[go-nuts] Re: delve and gdb cannot find go runtime

2017-03-31 Thread YZ Xie
> > I made a misstake, I have solved it by using source command, the add > safe-path was just set a safe directory, if need add a python script it > should use auto-load python-scripts, more details should go to gdb manual > Regards Xie -- You received this message because you are

Re: [go-nuts] Re: package, files at build (in relation to plugins, -linkshared, -buildmode=shared, ....)

2017-03-31 Thread Ian Lance Taylor
On Fri, Mar 31, 2017 at 9:28 AM, Basile Starynkevitch wrote: > > On Friday, March 31, 2017 at 4:14:19 PM UTC+2, Ian Lance Taylor wrote: >> >> On Fri, Mar 31, 2017 at 6:49 AM, Ian Lance Taylor >> wrote: >> > >> > It depends. The main command that

Re: [go-nuts] gdb can step in function call

2017-03-31 Thread Ian Lance Taylor
On Fri, Mar 31, 2017 at 8:37 AM, YZ Xie wrote: > > hi everyone, use gdb to debug golang, I find two question > 1. cannot use step / s to step in a function, is this for a wrong source > code path ? > 2.gdb cannot print variable value, is this because compile optimize ? Be

Re: [go-nuts] gdb can step in function call

2017-03-31 Thread Ian Lance Taylor
On Fri, Mar 31, 2017 at 8:37 AM, YZ Xie wrote: > > hi everyone, use gdb to debug golang, I find two question > 1. cannot use step / s to step in a function, is this for a wrong source > code path ? > 2.gdb cannot print variable value, is this because compile optimize ? Be

Re: [go-nuts] Is it harmful to always return invalid values on a non-nil-error?

2017-03-31 Thread Dave Cheney
> On 1 Apr 2017, at 11:02, Axel Wagner wrote: > > > >> On Sat, Apr 1, 2017 at 1:50 AM, Dave Cheney wrote: >> >> >>> On 1 Apr 2017, at 10:41, Axel Wagner wrote: >>> >>> So… Given that I'm not talking about

Re: [go-nuts] Is it harmful to always return invalid values on a non-nil-error?

2017-03-31 Thread Ian Lance Taylor
On Fri, Mar 31, 2017 at 3:33 PM, 'Axel Wagner' via golang-nuts wrote: > > there recently was a thread on /r/golang, about whether or not to explicitly > return useless values when an error occurred, or to just not care, as the > caller isn't supposed to use a return

Re: [go-nuts] Is it harmful to always return invalid values on a non-nil-error?

2017-03-31 Thread jimmy frasche
I never return a broken value with an error because there are occasions where returning both a value and an error make sense, such as a partial read. More than anything else, I'd rather make it clear that this is not one of those cases so I don't confuse myself later when I'm trying to track down

Re: [go-nuts] Is it harmful to always return invalid values on a non-nil-error?

2017-03-31 Thread 'Axel Wagner' via golang-nuts
On Sat, Apr 1, 2017 at 1:50 AM, Dave Cheney wrote: > > > On 1 Apr 2017, at 10:41, Axel Wagner > wrote: > > So… Given that I'm *not* talking about modifying any contract - see a) in > my previous message - but just making an effort that I'm not

Re: [go-nuts] Is it harmful to always return invalid values on a non-nil-error?

2017-03-31 Thread Dave Cheney
> On 1 Apr 2017, at 10:41, Axel Wagner wrote: > > So… Given that I'm not talking about modifying any contract - see a) in my > previous message - but just making an effort that I'm not contractual bound > by, I am not sure how I am supposed to read this. Is

Re: [go-nuts] Algorithm Club

2017-03-31 Thread David Collier-Brown
That's an interesting thought: one can generate a generic from a type which has an ordering, and identity and perhaps a few other functions as its interface. That eliminates the "grad student slave writing tests" from the algorithm (;-)) and makes it, in principle, computable in a Go kind of

Re: [go-nuts] Is it harmful to always return invalid values on a non-nil-error?

2017-03-31 Thread Dave Cheney
I think the simpler contract is to give no guarantee whatsoever of the state of the other return values in the presence of an error. It's a simple, clear, and most importantly consistent contact. To guarenteed that in the presence of an error the values that can be respresented by nil _will_

Re: [go-nuts] Is it harmful to always return invalid values on a non-nil-error?

2017-03-31 Thread 'Axel Wagner' via golang-nuts
I agree (as I said). But that wasn't the question. The question was, whether it is hurtful, for me, as the author of a function, to a) not give that guarantee, but b) still do my best do return obviously blowing up values (under the assumption that the users of my packages, me included, are not

[go-nuts] Is it harmful to always return invalid values on a non-nil-error?

2017-03-31 Thread Dave Cheney
My position is the caller cannot make any assertion about the state of the other values returned until they have checked the error. If the error was non nil then nothing can be said about the state of the other values returned. -- You received this message because you are subscribed to the

[go-nuts] Is it harmful to always return invalid values on a non-nil-error?

2017-03-31 Thread 'Axel Wagner' via golang-nuts
Hey gophers, there recently was a thread on /r/golang, about whether or not to explicitly return useless values when an error occurred, or to just not care, as the caller isn't supposed to use a return value on a non-nil value anyway. So, say, I have a type that wraps an *os.File (or a database

[go-nuts] Re: Accuracy of time.Sleep and time.Ticker

2017-03-31 Thread C Banning
On a MacBook Pro, 2.6 GHz Intel Core i7, 8 GB 1600 MHz DDR3, I get: 2017-03-31 15:51:00 -0600 MDT - next tick Current : 2017-03-31 15:51:00.8893 -0600 MDT Expected: 2017-03-31 15:51:00 -0600 MDT On Friday, March 31, 2017 at 1:44:44 PM UTC-6, apollo wellstein wrote: > > I seem to be

[go-nuts] Accuracy of time.Sleep and time.Ticker

2017-03-31 Thread mrawellstein
I seem to be having issues with the accuracy of time.Sleep and time.Ticker. Running this application below gives me these results: 2017-03-31 17:30:00 + UTC - next tick Expected: 2017-03-31 17:30:00 + UTC Current : 2017-03-31 17:30:02.871095796 + UTC package main import ( "fmt"

Re: [go-nuts] Re: Algorithm Club

2017-03-31 Thread David Collier-Brown
In a previous life, this was one of the problems we had with generate-and-execute. In lisp, you could almost always create correct code and run it. With C, I could generate library interposers by the ton, but they only *usually* worked, so I had to generate unit tests, too. Fortunately I had

Re: [go-nuts] Re: Algorithm Club

2017-03-31 Thread Egon
On Friday, 31 March 2017 19:20:26 UTC+3, Michael Jones wrote: > > There is part of the topic that has always been slightly beyond my grasp. > (Maybe I do understand...but just lack absolute certainty.) Maybe others > know the answer... > > In a template system (which is what I prefer but that's

Re: [go-nuts] Re: Algorithm Club

2017-03-31 Thread Jan Mercl
On Fri, Mar 31, 2017 at 6:20 PM Michael Jones wrote: > I recalled it i the sort case because I wanted to kinds of typed clients for "<", the kind where !Less(a,b)&&!Less(b,a) === Equal(a,b), and the kind where that is not the case--and ideally--a way to have

[go-nuts] Re: package, files at build (in relation to plugins, -linkshared, -buildmode=shared, ....)

2017-03-31 Thread Basile Starynkevitch
On Friday, March 31, 2017 at 6:28:40 PM UTC+2, Basile Starynkevitch wrote: > > I'm still really confused by getting quite often a very cryptic message: > > multiple roots /home/basile/go/pkg/linux_amd64 & > /usr/lib/go-1.8/pkg/linux_amd64_dynlink > > the funny thing is that both of these are

Re: [go-nuts] Re: Algorithm Club

2017-03-31 Thread Michael Jones
There is part of the topic that has always been slightly beyond my grasp. (Maybe I do understand...but just lack absolute certainty.) Maybe others know the answer... In a template system (which is what I prefer but that's not the point of this email) we have the notion of the TYPE(s) being a

[go-nuts] gdb can step in function call

2017-03-31 Thread YZ Xie
hi everyone, use gdb to debug golang, I find two question 1. cannot use step / s to step in a function, is this for a wrong source code path ? 2.gdb cannot print variable value, is this because compile optimize ? Best Xie root@ubuntu:~/fabric/build/bin# gdb peer -d $GOROOT ... Reading symbols

[go-nuts] Re: delve and gdb cannot find go runtime

2017-03-31 Thread YZ Xie
now I know why add-auto-load-safe-path didn't work, first it just add a safe path, it's a directory, second, because peer was build by old location go, so runtime library path was written in the debug info, can use source to overwrite this path, so this question was solved. 在 2017年3月31日星期五

[go-nuts] Re: package, files at build (in relation to plugins, -linkshared, -buildmode=shared, ....)

2017-03-31 Thread Ian Lance Taylor
On Fri, Mar 31, 2017 at 6:49 AM, Ian Lance Taylor wrote: > > It depends. The main command that generates output is `go install`, > and it stores the output under $GOROOT/pkg. Whoops, I meant $GOPATH/pkg. $GOROOT/pkg is only used for the standard library. Ian -- You received

Re: [go-nuts] Re: package, files at build (in relation to plugins, -linkshared, -buildmode=shared, ....)

2017-03-31 Thread Rob Pike
Here is how to see the transitive set of packages P depends on. go list -f $'{{range $f := .Deps}}{{$f}}\n{{end}}' P | sort On Fri, Mar 31, 2017 at 6:49 AM, Ian Lance Taylor wrote: > On Fri, Mar 31, 2017 at 5:00 AM, Basile Starynkevitch > wrote: > >

[go-nuts] Re: package, files at build (in relation to plugins, -linkshared, -buildmode=shared, ....)

2017-03-31 Thread Ian Lance Taylor
On Fri, Mar 31, 2017 at 5:00 AM, Basile Starynkevitch wrote: > > I don't understand as much for the Go compiler, using the go tool. In > particular I have a very incomplete understanding about : > > what is the exact structure and content of a Go compiled package file? >

[go-nuts] delve and gdb cannot find go runtime

2017-03-31 Thread YZ Xie
Hi everyone, I moved go from /usr/loca/dev/go to /usr/loca/go, then gdb and delve cannot find go runtime. how can I fix it? Reading symbols from peer...done. warning: Missing auto-load script at offset 0 in section .debug_gdb_scripts of file

[go-nuts] Re: problem about lldb debug go code

2017-03-31 Thread YZ Xie
I don't know, now I can use gdb to debug go code, and it can show code sucessfully, but it cannot show depended package code. need to set source file folder? 在 2017年3月25日星期六 UTC+8下午10:37:44,YZ Xie写道: > > > down votefavorite >

[go-nuts] Re: problem about lldb debug go code

2017-03-31 Thread YZ Xie
I made a simple misstake, because breakpoint was set on golang runtime code, 在 2017年3月25日星期六 UTC+8下午10:37:44,YZ Xie写道: > > > down votefavorite > > > if code and binary program is not in the same directory, use gdb and lldb

[go-nuts] Re: problem about lldb debug go code

2017-03-31 Thread YZ Xie
this problem was solved, I forget how did I do to solve it, but meet another problem 在 2017年3月25日星期六 UTC+8下午10:37:44,YZ Xie写道: > > > down votefavorite > > > if code and binary program is not in the same directory, use gdb

[go-nuts] package, files at build (in relation to plugins, -linkshared, -buildmode=shared, ....)

2017-03-31 Thread Basile Starynkevitch
Hello All, I'm using Go1.8 mostly with plugins on Linux x86-64 (and I am only interested in Go since it has plugins, since I love the idea of having my monimelt program -GPL code on gitbub- emit at *runtime* some Go "source" code, in some temporary

Re: [go-nuts] Re: `-pkgdir` option does not work with `go get` command

2017-03-31 Thread Dave Cheney
What is the reason you want to recompile all the source code? The go tool automatically recompiles anything that is out of date. What is the problem you are trying to solve by using -a to force recompilation of everything. -- You received this message because you are subscribed to the Google

[go-nuts] x/gomobile: does this project has ui support?

2017-03-31 Thread hui zhang
As far as I know , it is a wonderful work , just copy the concept for cocos2dx, it is quite suitable to build a cross platform game engine. however it is lack of a ui | particle | animation system. Much work need to be done. UI I think is the most important for now. But there seems no

Re: [go-nuts] Re: `-pkgdir` option does not work with `go get` command

2017-03-31 Thread QL Zhuo
Thank you Dave, I think go build would create the dir `pkg-1` during the building, but it didn't. My problem is `how to recompile all the source code`, and after a discussion at https://forum.golangbridge.org/t/pkgdir-option-does-not-work-with-go-get-command/5020/ it becomes to another: is

Re: [go-nuts] Re: Algorithm Club

2017-03-31 Thread Egon
On Friday, 31 March 2017 09:02:09 UTC+3, Will Faught wrote: > > >Because it can also be implemented in other ways. > > Do you mean interface{} can be implemented in other ways? I couldn't make > out your meaning. > There are multiple ways of implementing "boxing generics" and "interface{}".

[go-nuts] Re: `-pkgdir` option does not work with `go get` command

2017-03-31 Thread Dave Cheney
On Friday, 31 March 2017 16:58:15 UTC+11, KDr2 (ZHUO QL) wrote: > > My go workspace is simple: > > > [000]kdr2@Debian-X230:~/gows$ pwd > /home/kdr2/gows > [000]kdr2@Debian-X230:~/gows$ tree > . > └── src > └── test > └── m.go > > 2 directories, 1 file > > > And the content of m.go is

Re: [go-nuts] Re: Algorithm Club

2017-03-31 Thread Will Faught
>Because it can also be implemented in other ways. Do you mean interface{} can be implemented in other ways? I couldn't make out your meaning. >As said... there is a performance upside for some other approaches. The other approaches have downsides, or at least generation does. Compared to