Re: [go-nuts] Re: printing all errors from stdlib as they happen

2020-04-10 Thread Kevin Chadwick
On 2020-04-10 22:20, Brian Candler wrote: > > > I'm afraid I don't see the problem. > > That's an example of using the TLS API.  In this API, the user passes a > callback > function to be called at a certain point in the TLS exchange.  *Your* function > returns an err to say whether the certifi

Re: [go-nuts] testing code that uses ioutil.ReadDir?

2020-04-10 Thread Ian Lance Taylor
On Fri, Apr 10, 2020 at 3:37 PM 'K Richard Pixley' via golang-nuts wrote: > > I have some code. It uses ioutil.ReadDir which returns a possible error. > > My testing is at 99% code coverage because I can't figure out a way to > set up a situation in which os.Open succeeds on a directory, but > io

[go-nuts] testing code that uses ioutil.ReadDir?

2020-04-10 Thread 'K Richard Pixley' via golang-nuts
I have some code.  It uses ioutil.ReadDir which returns a possible error. My testing is at 99% code coverage because I can't figure out a way to set up a situation in which os.Open succeeds on a directory, but ioutil.ReadDir fails. I can get to 100% code coverage if I throw away the err rathe

Re: [go-nuts] Re: printing all errors from stdlib as they happen

2020-04-10 Thread Brian Candler
On Friday, 10 April 2020 15:39:53 UTC+1, Kevin Chadwick wrote: > > We should be wanting more eyes on code. Also it potentially is and was of > some > use, in the case of:tls Example "VerifyPeerCertificate > > "https://golang.org/pkg/crypto/tls/#example_Config_verifyPeerCertificate"; > > I'm afr

Re: [go-nuts] Sscanf() skip elements

2020-04-10 Thread Ian Lance Taylor
On Fri, Apr 10, 2020 at 10:17 AM 'Daniel Gorbe' via golang-nuts wrote: > > It is possible to skip elements of a string with Sscanf()? As in C with %*s. > > Example: > > var res string > > text := "A simple text" > > fmt.Sscanf(text, "%*s %*s %s", &res) > > fmt.Printf("%s\n", res) /

Re: [go-nuts] go commands hang indefinitely

2020-04-10 Thread juanmonroynieto
I'm not sure about those options, they are not available in my kill command implementation. I can add that my workaround wast to sleep ant then kill the process; because I had to use that repeatedly, I made it a function and called it euthanasia lol. It just disappeared. What did you expect wit

[go-nuts] Re: go commands hang indefinitely

2020-04-10 Thread juanmonroynieto
I had my computer reformated with a fresh image ( I can't do it myself because of company policy). I reinstalled go 1.14.1 and it is working fine. If I encounter the issue again I will try downgrading the go version. For the time being this made the problem go away. Thank you guys for your help

[go-nuts] Sscanf() skip elements

2020-04-10 Thread 'Daniel Gorbe' via golang-nuts
Hi! It is possible to skip elements of a string with Sscanf()? As in C with /%*s./ Example: /    var res string// / /    text := "A simple text"/ /    fmt.Sscanf(text, "%*s %*s %s", &res)/ /    fmt.Printf("%s\n", res) // print: "text"/ Best regards,     Daniel -- Daniel Gorbe GNU/Linux

[go-nuts] Re: How to know if interface{} data is nil w/o reflecting?

2020-04-10 Thread cpuidle
Good morning! I realize I'm reviving an age-old discussion here and apologize for bringing up the undead. I happend to run into this when my application panicked when some interfaces where initialized with nil mock objects instead of being left uninitialized as in production mode. Axel said:

[go-nuts] Re: go commands hang indefinitely

2020-04-10 Thread Jason E. Aten
Sounds like it might be a go1.14.1 bug. Try under go1.13.10 to check. -- 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. To

Re: [go-nuts] Re: printing all errors from stdlib as they happen

2020-04-10 Thread Kevin Chadwick
On 2020-04-10 14:05, Brian Candler wrote: > But why do you want this?  A library you called already returns a descriptive > error of what went wrong.  The library is a black box.  If you want to open > the > black box to learn how it works, that's fine, but not something most people > want > to d

Re: [go-nuts] Re: printing all errors from stdlib as they happen

2020-04-10 Thread Brian Candler
On Friday, 10 April 2020 12:22:30 UTC+1, Kevin Chadwick wrote: > > > I disagree, if baz threw and error then it itself should have printed an > error > before returning, saving me minutes of grepping. The calling function may > also > print a more pertinent logical error. I realise this would r

Re: [go-nuts] Re: printing all errors from stdlib as they happen

2020-04-10 Thread Kevin Chadwick
On 2020-04-09 10:17, Brian Candler wrote: Sorry, for some reason I missed this reply. > However without modifying the code (or changing the > language, so that every variable value remembers the line number where it was > last set), The Log package does that for you. This output can be redirect

[go-nuts] Re: Is it possible to segment CMD window on Windows and segment Terminal window on Linux with golang?

2020-04-10 Thread Jason E. Aten
If you insist on terminal (which as I pointed out, is a mistake; I have made it and learned better), then https://github.com/rivo/tview is probably the better choice versus termui. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

[go-nuts] Re: Is it possible to segment CMD window on Windows and segment Terminal window on Linux with golang?

2020-04-10 Thread Jason E. Aten
Terminals are a pain to work with. Since you want cross-platform anyway, you should just create a little web server within your Go program, and serve webpages to a browser. Believe this, it will save you vast amounts of time and energy. -- You received this message because you are subscribed to

[go-nuts] Re: Is it possible to segment CMD window on Windows and segment Terminal window on Linux with golang?

2020-04-10 Thread 洪嘉鴻
It looks interesting! However, it looks too difficult for me to do this. I just found this and use cross-compile to build Windows and Linux executables with Win10. Then, I executed the executables on Win10 and Linux(with VMware). Both of them could work. Now I'm

[go-nuts] [ANN] GoGi, Gide, emergent version 1.0

2020-04-10 Thread Randall O'Reilly
The GoGi GUI system https://github.com/goki/gi has now been released at version 1.0 -- the 3D framework is now in place and interoperates with the 2D framework (including embedding 2D in 3D scenes), and everything is working reliably so we can keep the API stable from this point onward. There a

[go-nuts] Re: Is it possible to segment CMD window on Windows and segment Terminal window on Linux with golang?

2020-04-10 Thread Jason E. Aten
https://github.com/gdamore/tcell/ tcell lets you do fine grain control of the terminal. https://github.com/gdamore/proxima5 is an example game written with it. However be aware the the terminal on Windows is generally... garbage. There aren't any r