Re: [go-nuts] atal error: all goroutines are asleep - deadlock!

2025-05-22 Thread Natxo Asenjo
On Thu, May 22, 2025 at 10:46 AM Jan Mercl <0xj...@gmail.com> wrote: > On Thu, May 22, 2025 at 10:15 AM natxo@gmail.com > wrote: > > > fatal error: all goroutines are asleep - deadlock! > > Something like this? https://go.dev/play/p/4mWJOZd9hgz > This works beautiflly, thanks! So adding the

Re: [go-nuts] atal error: all goroutines are asleep - deadlock!

2025-05-22 Thread Natxo Asenjo
hi, I did not close the other channels, but adding this to the select code seems to fix it: for { select { case err := <-errCh: fmt.Println(err) case data := <-resCh: fmt.Println("from result c

[go-nuts] Re: global var available in different files (same package)

2019-06-07 Thread Natxo Asenjo
On Friday, June 7, 2019 at 6:07:09 PM UTC+2, jake...@gmail.com wrote: > > > > It is unclear what the problem is. Global variables will be accessible > from any file that is part of package "main". As you said, you could > convert the strings in main(), then put them in some global variables, f

[go-nuts] global var available in different files (same package)

2019-06-06 Thread Natxo Asenjo
hi, I'd like to define a couple of global variables in a small cli app. The app has a few files but it's not large. What I'd like is to use cli flags to define options, and those options should be available for all the functions. I quite like the fact that the content of the variables is check

Re: [go-nuts] trouble passing an argument to a script

2019-02-26 Thread Natxo Asenjo
On Tue, Feb 26, 2019 at 10:58 AM Natxo Asenjo wrote: > > hi, > > On Tuesday, February 26, 2019 at 10:51:28 AM UTC+1, Sebastien Binet wrote: >> >> from the compilation error, it would seem kingpin.Flag...ExistingFile() >> returns a *string, not a string. >> so

Re: [go-nuts] trouble passing an argument to a script

2019-02-26 Thread Natxo Asenjo
hi, On Tuesday, February 26, 2019 at 10:51:28 AM UTC+1, Sebastien Binet wrote: > > from the compilation error, it would seem kingpin.Flag...ExistingFile() > returns a *string, not a string. > so these lines: > fmt.Printf("%v, %s, %T\n", config, config, config) > cfg, err := ini.Load(config) >

[go-nuts] trouble passing an argument to a script

2019-02-26 Thread Natxo Asenjo
hi, I am writing a script that accepts arguments and flags (using kingpin) but am failing miserably so far. One of the arguments is a file name, which should be then loaded by an ini library (file is in ini format). If I hard code the file name in the script, it works, but Code:

Re: [go-nuts] [crypto/x509] SystemCertPool() print subjects of ca certs

2018-10-31 Thread Natxo Asenjo
On Wednesday, October 31, 2018 at 10:46:41 PM UTC+1, golan...@geek1.de wrote: > > Hy Natxo, > > check out the pkix [0] and asn1 [1] packages. You can try to parse the > DER encoded subject into RDNSequence. > > [0]: https://golang.org/pkg/crypto/x509/pkix/#RDNSequence > [1]: https://golang.o

[go-nuts] [crypto/x509] SystemCertPool() print subjects of ca certs

2018-10-31 Thread Natxo Asenjo
hi, as a learning exercise I would lke to loop through the system's certificate authorities store, and get the subjects of each certificate authority. I have this code: package main import "fmt" import "crypto/x509" func main() { store, err := x509.SystemCertPool() if err != nil {