Re: [go-nuts] Re: vendoring related question/issue

2021-05-09 Thread Sachin Puranik
Hi Sean, Thanks for the response. Though I am not sure if the solution satisfies my use case. I am doing some experimentation and will get back to you soon with the findings. Thanks and Regards, Sachin. On Sun, May 9, 2021 at 9:47 PM Sean Liao wrote: > `go mod vendor` only includes what is need

[go-nuts] Re: encoding/json: add FlexObject for encoding/decoding between JSON and flex Go types.

2021-05-09 Thread Ally Dale
see the reffer issue both json.RawMessage and interface{} cannot solve this problem. ```Go // AnimalRaw can only used to delay decoding JSON type AnimalRaw struct { Kind string `json:"kind"` Attr json.RawMessage `json:"attr"` }

[go-nuts] Search for directory named BigZoom and list contents.

2021-05-09 Thread Adam C
I'm trying to come up with a fairly small script to find a directory and then list the contents of a given directory name. The filestructure is thus: /root/1/1 /root/1/2 /root/1/BigZoom /root/1/BigZoom/1 /root/2/1 /root/2/2 /root/2/BigZoom /root/2/BigZoom/1 I want to find any file in a directo

[go-nuts] Re: encoding/json: add FlexObject for encoding/decoding between JSON and flex Go types.

2021-05-09 Thread Brian Candler
On Sunday, 9 May 2021 at 13:30:59 UTC+1 Ally Dale wrote: > But the way of [generate a sample JSON]( > https://github.com/vipally/glab/blob/master/lab27/json_raw_test.go#L38) > in this case looks ugly: > > It doesn't have to be as ugly as that: https://play.golang.org/p/BUjUNtJP_rG -- You receiv

[go-nuts] Re: vendoring related question/issue

2021-05-09 Thread Sean Liao
`go mod vendor` only includes what is needed to build your main module. 1.16 has https://pkg.go.dev/embed so you can embed static assets (such as template/html files) into your final binary (they will also be available in the vendor directory but I don't think this is your final goal) On Sunday,

[go-nuts] vendoring related question/issue

2021-05-09 Thread Sachin Puranik
Hi Gophers, I noticed the following issue while vendoring the library. Preface : Basically, I created the module, for myself. This module contains rendering templates and HTML files, few test files alongside the code. they are all tightly coupled to my module. Issue: when I use this module in a

[go-nuts] Re: Suggestion to extend x/OAuth2 API

2021-05-09 Thread cpu...@gmail.com
There is some support for a configurable token source in https://github.com/golang/oauth2/pull/448#issuecomment-835811792, no feedback otherwise. Cheers, Andi On Thursday, April 22, 2021 at 6:10:38 PM UTC+2 cpu...@gmail.com wrote: > After working with a few more-or-less OAuth2 APIs lately, I w

[go-nuts] Re: Reflect on Rust for Android and Linux kernel support

2021-05-09 Thread peterGo
On Sunday, May 9, 2021 at 3:40:52 AM UTC-4 Uli Kunitz wrote: > > I have only read about researchers who wrote a whole kernel in Go. > > UIi > The benefits and costs of writing a POSIX kernel in a high-level language Cody Cutler, M. Frans Kaashoek, and Robert T. Morris, MIT CSAIL https://www.usen

[go-nuts] encoding/json: add FlexObject for encoding/decoding between JSON and flex Go types.

2021-05-09 Thread Ally Dale
reffer issue ## Sometimes we have to deal with JSON that with unknown data types. Such as [sample JSON](https://github.com/vipally/glab/blob/master/lab27/json_test.go#L9) below: ``` [ { "kind":"dog", "attr":{ "type":"Col

[go-nuts] Re: Reflect on Rust for Android and Linux kernel support

2021-05-09 Thread winn
Thanks Uli and Amnon. I'm now better understand the reason behinds, and you've list some solid point. and it's reasonable for it to work that way. I'm here just list some possibilities: > 1. * Go requires a garbage collector and its own scheduler (A Go without GC and goroutines is not Go.) > 2

[go-nuts] Re: Reflect on Rust for Android and Linux kernel support

2021-05-09 Thread Amnon
I would agree with all Uli's points. I would add that not that many kernel developers - around 15,000 and most of these just write device drivers. So kernel development is very much a niche occupation. C as a very low level language - basically a pretty assembler, with no runtime, is ideally suit

[go-nuts] Re: Reflect on Rust for Android and Linux kernel support

2021-05-09 Thread Uli Kunitz
There are multiple differences that make Rust a better replacement for C/C++ code than Go: * Go requires a garbage collector and its own scheduler (A Go without GC and goroutines is not Go.) * Go has its own ABI and CGO calls are slow * Rust makes guarantees about memory safety that Go doesn't d