[go-nuts] protoc-gen-go uses deprecated libraries

2020-10-19 Thread bsr
Hello, I am coming back to a project after few months, and there has been changes to the protobuf libraries. I read the blog post, and docs followed the instructions to install and use the library. Please see the bel

Re: [go-nuts] strict type assignability to prevent arbitrary values

2019-11-07 Thread bsr
Thanks Jan & Peter. I would use one of the approaches. On Thursday, November 7, 2019 at 8:15:20 AM UTC-5, speter wrote: > > Hi bsr, > > I'd suggest to use a struct type with a single string field. It will > prevent conversion from untyped string constant "by mistake&

[go-nuts] strict type assignability to prevent arbitrary values

2019-11-07 Thread bsr
Hello, I am a long time user of go, but I always had the impression that below code would not work as string and Status are different type. I thought I need to explicitly convert as ```exec(Status("abc"))``` it to work. I think, this part of the spec may be the reason https://golang.org/ref/sp

Re: [go-nuts] Locate source code path (to import for code gen) of go module enabled project.

2018-11-07 Thread bsr
o/packages in > place of go/build. It handles everything from import finding to type > checking. > > Any further questions/problems please ask > > On Wed, 7 Nov 2018, 04:35 bsr wrote: > >> How can I find the path (directory) of a package which uses go module >>

[go-nuts] Locate source code path (to import for code gen) of go module enabled project.

2018-11-06 Thread bsr
How can I find the path (directory) of a package which uses go module (1.11). I had code (for go:generate) which uses package name to locate source code relative to GOPATH and import using https://golang.org/pkg/go/build/#Import Now, once I started using module, the package name is prefixed

[go-nuts] Re: Announcing: Skylark in Go

2017-11-08 Thread bsr
looks like Nate has the answer :-) https://github.com/hippogryph/skyhook On Tuesday, November 7, 2017 at 10:29:06 PM UTC-5, bsr wrote: > > Like Nate mentioned, I too like to try it instead of lua. Is there a good > example on how to embed skylark to define custom logic. Thanks. >

[go-nuts] Re: Announcing: Skylark in Go

2017-11-07 Thread bsr
Like Nate mentioned, I too like to try it instead of lua. Is there a good example on how to embed skylark to define custom logic. Thanks. On Monday, October 2, 2017 at 12:39:43 PM UTC-4, Alan Donovan wrote: > > I'm pleased to announce the launch of Skylark in Go: an interpreter for > Skylark, im

Re: [go-nuts] fmt verb to single quote text

2017-01-05 Thread bsr
Andrew.. thank you so much. that works great.. On Thursday, January 5, 2017 at 3:37:51 PM UTC-5, Diddymus wrote: > > Maybe https://play.golang.org/p/9EewyQhD3U ? > > On Thursday, 5 January 2017 17:06:07 UTC, bsr wrote: >> >> Alexander. thank you very much for helping ou

Re: [go-nuts] fmt verb to single quote text

2017-01-05 Thread bsr
to convert to support multi line string like `hello ... \n world` thanks in advance, bsr. On Thursday, January 5, 2017 at 11:52:39 AM UTC-5, Alexander Kapshuk wrote: > > On Thu, Jan 5, 2017 at 6:45 PM, bsr > > wrote: > > Please see the example https://play.golang.org/p/SeG

[go-nuts] fmt verb to single quote text

2017-01-05 Thread bsr
uot;hello ... \n world"} how can I do that? thanks, bsr. -- 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

[go-nuts] Re: How to pass a go file name as arguments to go run

2017-01-05 Thread bsr
bably reached the practical limit of what go run should be > used for. I recommend using the expected GOPATH package layout, go > build/install, etc. > > On Thursday, 5 January 2017 16:02:50 UTC+11, bsr wrote: >> >> Following works. >> >> go run cmd/main.go

[go-nuts] How to pass a go file name as arguments to go run

2017-01-04 Thread bsr
Following works. go run cmd/main.go tests/a/in flag.Parse() args := flag.Args() //args -> []string{"tests/a/in"} but when I do go run cmd/main.go tests/a/in.go named files must all be in one directory; have cmd/ and tests/a/ I am not trying to build both files, but "tests/a/in.go: is an

[go-nuts] basic hex encoding

2016-12-20 Thread bsr
sorry for such a trivial question, but my understanding of encoding on different bases are limited. In the below code https://play.golang.org/p/q-F0p00bie ``` package main import ( "encoding/hex" "fmt" ) func main() { id, err := hex.DecodeString("32") if err != nil { panic(err) } // id => [

[go-nuts] Re: time representation to use with javascript

2016-10-10 Thread bsr
Just saw that time implements MarshalJSON, so may be string output may be better. https://golang.org/src/time/time.go?s=26891:26934#L918 On Monday, October 10, 2016 at 11:22:48 PM UTC-4, bsr wrote: > > Hello, > > I store all time values in UTC, and since it runs on google app en

[go-nuts] time representation to use with javascript

2016-10-10 Thread bsr
umber <http://ecma262-5.com/ELS5_HTML.htm#Section_8.5>(it is ok to lose precision to milliseconds). Thank you, bsr. -- 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, se