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