Re: [go-nuts] TLS dial error pkg variables - Best way to logically detect the type of tls failure

2020-06-07 Thread Matt Harden
I suspect your (possibly wrapped) error will be of type x509.UnknownAuthorityError, so you should be able to check for it with errors.As: var uaerr x509.UnknownAuthorityError if errors.As(err, ) { // handle as an unknown authority error } On Tue, Jun 2, 2020 at 8:22 AM Kevin Chadwick wrote:

Re: [go-nuts] Re: Preventing SIGBUS errors when memmove-ing an unsafe.Pointer to multiple destinations

2020-06-07 Thread keith . randall
Showing us some code would really help. It's hard to understand what you are doing from this brief description. Also, where does the SIGBUS occur? What pc, and what address? What types are you passing as the first argument to typedmemmove? Where did you get them from? This is a fine question

[go-nuts] Add string Parser to x/tools/stringer

2020-06-07 Thread Diego Augusto Molina
Very often I use the stringer command to generate lists of enumerated values, which is great btw. But one thing that I see myself also writing after this is a Parse method or function to validate strings that are received. The use case is that I have a list of possible values for a controlled

Re: [go-nuts] Re: Preventing SIGBUS errors when memmove-ing an unsafe.Pointer to multiple destinations

2020-06-07 Thread Michael Jones
Thank you. I now officially know that I don’t understand. Sorry. On Sun, Jun 7, 2020 at 7:54 AM Viktor Kojouharov wrote: > The pointer is being copied via typedmemmove, which itself calls memmove, > which, according to its documentation, copies bytes from the source to the > destination. Not

Re: [go-nuts] Re: developing local packages with modules

2020-06-07 Thread Erwin
Yes Brian, this the way it is done in the "How to write Go code" article, and it indeed works. At least, when package morestrings is imported in the hello module where it is part of. I did get that to work, but... i wanted to take the next step and import that package morestrings in a whole new

Re: [go-nuts] Re: Preventing SIGBUS errors when memmove-ing an unsafe.Pointer to multiple destinations

2020-06-07 Thread Viktor Kojouharov
The pointer is being copied via typedmemmove, which itself calls memmove, which, according to its documentation, copies bytes from the source to the destination. Not sure why that would be impossible, considering it does work for some code (the source pointer preserves its data) Not sure what

[go-nuts] Re: developing local packages with modules

2020-06-07 Thread Brian Candler
On Sunday, 7 June 2020 14:20:40 UTC+1, Erwin Driessens wrote: > > > However, my next quest was to import the hello/morestrings package in > another module and use it there. I can['t] get it to work :( > Does anyone know of a good document/wiki/tutorial about developing go code > that is not on

Re: [go-nuts] Re: Preventing SIGBUS errors when memmove-ing an unsafe.Pointer to multiple destinations

2020-06-07 Thread Michael Jones
Do you mean that you have a problem with the value of the pointer? That is "copying the pointer." This seems impossible. Attempting to access through a pointer copied via unsafe is (generally) inviting doom, and seems highly possible. The instant the last pointer to that data goes out of scope

Re: [go-nuts] developing local packages with modules

2020-06-07 Thread Erwin
Thanks Micheal, i will read those articles. But won't it be very cumbersome to have to edit the go.mod file all the time? It seems like it would break the flow. On Sun, 7 Jun 2020 at 15:31, Michael Stiller wrote: > Hi, > > if the you want to use is on the local system you can add something

[go-nuts] Re: developing local packages with modules

2020-06-07 Thread Erwin Driessens
should be: "i can't get it to work", instead of "i can get it to work", sadly enough On Sunday, June 7, 2020 at 3:20:40 PM UTC+2, Erwin Driessens wrote: > > Hello people > i have always found modules very scary and complicated but now there seems > to be no way round any longer. > I have a lot

Re: [go-nuts] developing local packages with modules

2020-06-07 Thread 'Michael Stiller' via golang-nuts
Hi, if the you want to use is on the local system you can add something like this to the go.mod file: replace github.com/yourrepo/module => ../pkg/module See also here: https://thewebivore.com/using-replace-in-go-mod-to-point-to-your-local-module/ and here:

[go-nuts] developing local packages with modules

2020-06-07 Thread Erwin Driessens
Hello people i have always found modules very scary and complicated but now there seems to be no way round any longer. I have a lot of packages that i do now want to put in repositories. I want them to be locally accessible, without internet access. Everything always worked great for me with

[go-nuts] Re: Preventing SIGBUS errors when memmove-ing an unsafe.Pointer to multiple destinations

2020-06-07 Thread Viktor Kojouharov
p.s. should such questions be posted in golang-dev, since it deals with runtime internals? -- 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] Preventing SIGBUS errors when memmove-ing an unsafe.Pointer to multiple destinations

2020-06-07 Thread Viktor Kojouharov
Hi, I'm playing around with the runtime, copying some data behind unsafe.Pointer to a destination whenever a function is invoked. I'm currently doing it with the 'typedmemmove' function from within the runtime. That works for certain code, but panics with "unexpected fault address" - going