Re: [go-nuts] Elementary Question About Calling Functions in Different Packages

2022-06-09 Thread Kurtis Rader
On Thu, Jun 9, 2022 at 7:06 PM jlfo...@berkeley.edu wrote: > How can this program be made to work? I've tried many things, which all >>> lead back >>> to the situation I describe above. >>> >> >> You need to refactor the code to eliminate the import cycle. >> https://jogendra.dev/import-cycles-in

Re: [go-nuts] Elementary Question About Calling Functions in Different Packages

2022-06-09 Thread jlfo...@berkeley.edu
Thanks for the quick inciteful response. > From https://go.dev/ref/spec#Import_declarations: > > > It is illegal for a package to import itself, directly or indirectly, > or to directly import a package without referring to any of its exported > identifiers. > > I should have researched this

Re: [go-nuts] Elementary Question About Calling Functions in Different Packages

2022-06-09 Thread Kurtis Rader
On Thu, Jun 9, 2022 at 5:18 PM jlfo...@berkeley.edu wrote: > I'm having trouble understanding what should be a trivial issue. > > I have the following file structure: > > . > ├── go.mod > ├── main.go > ├── p1 > │ └── p1.go > └── p2 > └── p2.go > > The files are small and simple. > > -- go.

[go-nuts] Elementary Question About Calling Functions in Different Packages

2022-06-09 Thread jlfo...@berkeley.edu
I'm having trouble understanding what should be a trivial issue. I have the following file structure: . ├── go.mod ├── main.go ├── p1 │ └── p1.go └── p2 └── p2.go The files are small and simple. -- go.mod module wp go 1.18 -- main.go // main.go package main import ( "wp/p1"

Re: [go-nuts] unrecognized import path "code.google.com/p/go.crypto/openpgp"

2022-06-09 Thread 'Dan Kortschak' via golang-nuts
On Thu, 2022-06-09 at 14:21 -0700, Peter Sjolin wrote: > I attempted to use "code.google.com/p/go.crypto/openpgp" in my > project and got the following error: > $ go get code.google.com/p/go.crypto/openpgp > go: unrecognized import path "code.google.com/p/go.crypto/openpgp": > parse https://code.go

[go-nuts] unrecognized import path "code.google.com/p/go.crypto/openpgp"

2022-06-09 Thread Peter Sjolin
I attempted to use "code.google.com/p/go.crypto/openpgp" in my project and got the following error: $ go get code.google.com/p/go.crypto/openpgp go: unrecognized import path "code.google.com/p/go.crypto/openpgp": parse https://code.google.com/p/go.crypto/openpgp?go-get=1: no go-import meta tags

[go-nuts] Re: Implementation for Copy-On-Write

2022-06-09 Thread Brian Candler
You can trim most of it out. Instead of the 'insert' func, just m.Store() the new value. But that isn't Copy-On-Write. This is simply replacing the value in a variable with another value. Anybody who read out the old value, still has their copy of the old value, probably stored in some variab

Re: [go-nuts] encoding/asn1 overly strict?

2022-06-09 Thread Brian Candler
I forgot to add one thing, and you didn't paste the whole certificate PEM so I can't check this. Recent versions of Go won't verify the certificate unless it contains a subjectAltName; matching against only the CN is no longer supported. So if you do get your vendor to re-issue the cert, make

[go-nuts] Implementation for Copy-On-Write

2022-06-09 Thread ag9920
Copy-On-Write is a classic way to deal with concurrency problems in the "frequently read, but infrequently updated" scenario. I noticed an interesting discussion from a previous conversation: https://groups.google.com/g/golang-nuts/c/zyQnord8hyc. The author of weed-fs tried to implement Copy-On

Re: [go-nuts] encoding/asn1 overly strict?

2022-06-09 Thread Brian Candler
On Thursday, 9 June 2022 at 14:27:04 UTC+1 cpu...@gmail.com wrote: > We receive an alert 40 (Handshake failure ) when using openssl. So the > cert is definitively faulty in some way. > > :~/wallbox/hack$ openssl s_client -connect 192.168.1.180:4712 > Certainly it will report a failed verifica

[go-nuts] Re: How to use thrifter.ToJSON() function

2022-06-09 Thread jake...@gmail.com
>From your first question, it appears that you have never used Go before. I would start with the intro tutorial: A Tour of Go . Other resources and tutorials on the official documentation page might also be helpful. I would also note that the thrift-i

Re: [go-nuts] encoding/asn1 overly strict?

2022-06-09 Thread cpu...@gmail.com
On Wednesday, June 8, 2022 at 5:53:50 PM UTC+2 Brian Candler wrote: > On Wednesday, 8 June 2022 at 10:09:26 UTC+1 andig wrote: > >> We've not found an approach for communicating with the device sofar >> unless using patched Go stdlib. >> > > Connect via a proxy like stunnel? > > Out of interest,

[go-nuts] Re: Quick poll: Which of these declarative UI trees looks the most legible to you?

2022-06-09 Thread atd...@gmail.com
Someone did suggest implementing the tree using structs to reduce indentation. I thought about it. However, there is no inheritance (thankfully!) and types are invariant (no covariance/contravariance) in Go so I'm afraid it wouldn't compose. Unless I'm missing something? On Thursday, June 9