Re: [go-nuts] Is there a way to cast interface to embedded type?

2024-02-12 Thread Christopher C
Thanks to both of you. I'll try out your suggestions. On Friday, February 9, 2024 at 4:35:31 PM UTC-5 Mike Schinkel wrote: > On Feb 9, 2024, at 3:37 PM, Christopher C wrote: > > I have a base struct that implements an interface. There are multiple > other structs that embed

[go-nuts] Is there a way to cast interface to embedded type?

2024-02-09 Thread Christopher C
I have a base struct that implements an interface. There are multiple other structs that embed this base struct. I would like to pass the an interface into a function that can cast it as the base struct and call some functions tied to the base struct. Something like this... https://go.dev/pla

[go-nuts] Re: Handling EOF when using json.NewDecoder() from named pipe

2023-10-17 Thread Christopher C
ing > everything (io.ReadAll) until EOF and json.Unmarshal'ling > would be a cleaner/simpler solution? > > V. > > On Tuesday, 17 October 2023 at 09:10:09 UTC+2 Christopher C wrote: > >> Hello all! >> I'm trying to read json objects from a named pipe. The pipe will

[go-nuts] Handling EOF when using json.NewDecoder() from named pipe

2023-10-17 Thread Christopher C
Hello all! I'm trying to read json objects from a named pipe. The pipe will be filled intermittently by bash scripts. After the Decode() of the first object, any more calls to Decode() will return EOF. This seems proper since the script has completed, but once it errors with EOF, there doesn

Re: [go-nuts] Function to escape and unscape string

2021-08-29 Thread Christopher Puschmann
Hi, have you tried fmt.Sscanf? https://play.golang.org/p/Ebr9VcobOcE On 29.08.2021 21:52, 'nadashin' via golang-nuts wrote: > fmt.Printf has a format specifier, %q that escapes string with Go syntax and > add quotes around the string. ( %#v also does it) But it doesn't have one > that unesca

[go-nuts] Q about memory allocation/cleanup with interfaces

2020-09-11 Thread Christopher Crotty
Apologies in advance if this is not the right group to post this... I am having a memory leak issue in an app that reads data reports from a sensor and stores them for a length of time. Running pprof on the app, It appears that the memory is not getting released when the old data is purged.

Re: [go-nuts] "go build" breaks with go modules -- error messages says repo is trying to import itself...

2019-07-02 Thread 'Christopher Dang' via golang-nuts
yes. i was able to get it to work with "go build ./..." On Tue, Jul 2, 2019 at 2:56 PM Burak Serdar wrote: > On Tue, Jul 2, 2019 at 3:53 PM christopher.dang via golang-nuts > wrote: > > > > Hello, I'm migrating my codebase from dep to go modules. I'm able to run > go get ./... without any probl

Re: [go-nuts] Re: godoc memory leak

2019-06-20 Thread 'Christopher Dang' via golang-nuts
When I ran the godoc service in a docker image with less memory (6 GiB) the behavior was the same. For both a 8 GiB and 6 GiB machine, the godoc process continue to consume memory until it surpasses the memory on the machine and crashes. After the crash, the other processes on my machine continue t

Re: [go-nuts] Re: godoc memory leak

2019-06-19 Thread 'Christopher Dang' via golang-nuts
cted > to increase. But it seems sometimes it is increasing even when there is no > change. > > Could you please file an issue so that folks can investigate this ? Thanks. > > On Tue, Jun 18, 2019, 10:17 PM Christopher Dang < > christopher.d...@wework.com> wrote:

[go-nuts] Re: Plan9 reborn as a guest OS atop of Golang runtime

2018-12-11 Thread Christopher Sebastian
Also, don't forget about the pinnacle of human achievement in OS design: Inferno. https://en.wikipedia.org/wiki/Inferno_(operating_system) http://www.vitanuova.com/inferno/ https://bitbucket.org/inferno-os/inferno-os Inferno was written in the early 90's by Ken Thompson, Rob Pike, Roger Peppé,

Re: [go-nuts] Re: Command line password manager using AES symmetric key encryption, Argon2 KDF, Key-Agent and Keepass importer

2018-10-16 Thread Christopher Nielsen
It is the coupling of the two scenarios - the security cannot be based on the > hardware device alone (since it can be lost/stolen), and when there is backup > identifying information, that can be compromised (if the machine is > compromised). > > I know very well how the hardw

Re: [go-nuts] Re: Command line password manager using AES symmetric key encryption, Argon2 KDF, Key-Agent and Keepass importer

2018-10-15 Thread Christopher Nielsen
't matter if you have root access. You cannot obtain key material from it. If you lose it, you lose the set of keys on it. That's it. Revoke them and issue new ones using your root cert/key that never touches a networked system and lives in a safe. -- Christopher Nielsen "They who ca

Re: [go-nuts] Re: Command line password manager using AES symmetric key encryption, Argon2 KDF, Key-Agent and Keepass importer

2018-10-15 Thread Christopher Nielsen
dware security device is more secure than the alternatives. Saying "that is not really the case" isn't correct. > Security is always a trade-off. Though I didn't state that explicitly, I feel it was implicit in my comments about threat modeling. -- Christopher Nielsen "The

Re: [go-nuts] Re: Command line password manager using AES symmetric key encryption, Argon2 KDF, Key-Agent and Keepass importer

2018-10-15 Thread Christopher Nielsen
a hardware token with keychain. We seem to have wandered pretty far afield of the topic of this forum. -- Christopher Nielsen "They who can give up essential liberty for temporary safety, deserve neither liberty nor safety." --Benjamin Franklin "The tree of liberty must be refreshed

Re: [go-nuts] Re: Command line password manager using AES symmetric key encryption, Argon2 KDF, Key-Agent and Keepass importer

2018-10-15 Thread Christopher Nielsen
the > file encryption on disk, no ? > > > On Oct 15, 2018, at 4:13 PM, Christopher Nielsen > > wrote: > > > > On Mon, Oct 15, 2018 at 1:28 PM Matthias Schmidt > > wrote: > >> > >> Hi Eric, > >> > >> thanks *a lot* for your valua

Re: [go-nuts] Re: Command line password manager using AES symmetric key encryption, Argon2 KDF, Key-Agent and Keepass importer

2018-10-15 Thread Christopher Nielsen
ectre and Meltdown, so it isn't safe to assume the kernel or hardware are secure. A password manager needs to have a robust security model that has a minimal trust model if it is to be more than a toy. Just my $0.02 -- Christopher Nielsen "They who can give up essential liberty for temp

[go-nuts] Re: I am not in favor of generics.

2018-09-18 Thread Christopher Sebastian
lexity and probably led me to write more-difficult-to-understand code. The longer I use Go, the more beautiful it becomes. It's already elegant and powerful, and we shouldn't add fancy features just to please a crowd. Thank you Go Team! ~Christopher -- You received this message because y

Re: [go-nuts] Re: Go’s runtime vs virtual machine

2018-09-04 Thread Christopher Nielsen
garbage collection, and more. > > the Go runtime is written in Go mostly and uses C or assembler to connect > to the host operating system. > the Go runtime is linked with the developer's Go code, and the two of them > are constitute the output of go build or go install >

Re: [go-nuts] Re: Go’s runtime vs virtual machine

2018-09-04 Thread Christopher Nielsen
Hi Pablo, Yes, that sounds like a reasonable differentiation for students. Of course, it is more complex than that, but it's a good first principles introduction. Cheers, Chris On Tue, Sep 4, 2018, 16:57 Pablo Rozas Larraondo < p.rozas.larrao...@gmail.com> wrote: > Thanks for the answers. I as

Re: [go-nuts] Re: Ternary ... again

2018-08-16 Thread Christopher Nielsen
How is a ternary more readable? I've found that they make code more complex and unreadable, in both C and the proposed go, and the one-liner you provide is equally or more unreadable than the more verbose if statement. On Thu, Aug 16, 2018, 16:55 Liam Breck wrote: > Indeed, the problem is largel

Re: [go-nuts] Re: infinite recursion in method lookup due to recursive embedded interface value: any way to statically catch this?

2018-03-13 Thread Christopher Sebastian
@prades.marq , The solution that you pointed out is already obvious to everyone. Maverick was not asking "how" to solve the problem. He is pointing out an interesting corner-case bug in the Go runtime. -- You received this message because you are subscribed to the Google Groups "golang-nuts" g

[go-nuts] Re: infinite recursion in method lookup due to recursive embedded interface value: any way to statically catch this?

2018-03-13 Thread Christopher Sebastian
some use-case I'm overlooking? Thanks, ~Christopher -- 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. F

Re: [go-nuts] Re: ANN: gijit, a Go interpreter

2018-02-08 Thread Christopher Sebastian
Thanks for the great explanation, Jason. It really helps me to understand the high-level-view much better. :) ~Christopher -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails fro

[go-nuts] Re: ANN: gijit, a Go interpreter

2018-02-08 Thread Christopher Sebastian
t a very manual process? Thanks for working on this important project! ~Christopher Sebastian -- 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+uns

Re: [go-nuts] Re: Ternary operator needed in Go

2017-10-16 Thread Christopher
Python resisted this for a while, depending on it's OR behavior. However, the OR behavior has a lot of critics and criticisms. See https://www.python.org/dev/peps/pep-0308/ The if expression is really nice, and quite clear. I use it a lot. It doesn't require null types or other exotic feature

Re: [go-nuts] Question on os.Cmd() and go routines

2017-08-05 Thread Christopher Nielsen
more options, visit https://groups.google.com/d/optout. -- Christopher Nielsen "They who can give up essential liberty for temporary safety, deserve neither liberty nor safety." --Benjamin Franklin "The tree of liberty must be refreshed from time to time with the blood of patriots & ty

Re: [go-nuts] Proper way to construct|format this code...

2017-07-30 Thread Christopher Nielsen
Use gofmt. On Jul 30, 2017 13:21, wrote: > What is the standard way to construct|format the following code snippet? > I think the first is more readable; however, is there any accepted syntax I > should be using working my way up the ladder as a senior developer? > > block, err := aes.NewCipher(

Re: [go-nuts] swig and go

2017-04-12 Thread Christopher Nielsen
For c++, your swig file needs to have a swigcxx extension for the go tool to run swig properly. On Apr 12, 2017 4:42 PM, "larry104" wrote: I seems I need to manually run swig (swig -go -cgo -c++ -intgosize 64 mylib.i) - it does not seem that 'go build' picks up the .i or .swig file. Then I need