[go-nuts] Re: Mutual tls example

2019-04-22 Thread Timothy Raymond
I believe Liz Rice covered this in her GopherCon 2018 talk on TLS 
connections: https://www.youtube.com/watch?v=kxKLYDLzuHA

On Sunday, April 21, 2019 at 8:09:17 AM UTC-4, Vasiliy Tolstov wrote:
>
> Hi, I'm try to find mutual tls example in go, but can't find simple 
> example that uses crypto/tls. I need server that for some http handler for 
> user request with token returns tls cert for communication, and client that 
> uses this cert to communication after it returned from request. Ideally 
> with ability to rotate keys on client before previous expired.
> Does anybody knows it?
>
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: http "alt" attribute value for img tag?

2018-04-19 Thread Timothy Raymond
You should have a look at http://go-colly.org . I've done scraping with 
html.Parse before, and I wish Colly existed when I did.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] alternate struct tags for json encode/decode?

2018-04-11 Thread Timothy Raymond
It wasn’t always possible. I think this ability was added around 1.8 to 
expressly make multiple “views” of a struct easier by ignoring tags in the 
identity of the struct: https://go-review.googlesource.com/c/go/+/30169

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Fixing the version of protoc-gen-go

2018-03-23 Thread Timothy Raymond
I've been running protoc and protoc-gen-go in a container (and fixing versions 
by checking out commits) to try to address this problem for my projects. I'd 
love to hear what others have done though.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] A small question on os.FileInfo

2017-08-13 Thread Timothy Raymond
I was working with filepath.Walk(), and I noticed something peculiar about 
the os.FileInfo interface that the filepath.WalkFunc receives. According to 
the definition here: https://golang.org/pkg/os/#FileInfo, the Size() method 
returns an int64. Shouldn't this be a uint64? Is there a sane instance on 
some platform of a negative file size?

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Goroutines chan to get data at specific time

2017-08-06 Thread Timothy Raymond
I'm not entirely sure, but my intuition says that using `time.After` like 
that with pending sends from another goroutine will cause that goroutine to 
leak. A better solution may be to use the `WithTimeout` functionality of 
the `context` package and then periodically check the `Done()` channel to 
see if the timeout has expired. It works something like this if you imagine 
`HeavyWork` is a call to an external API: 
https://play.golang.org/p/DRtgNBLnE5 .

On Sunday, August 6, 2017 at 3:53:36 AM UTC-4, Abhijit Desai wrote:
>
> Can you please help with below code to get output at specific cutoff time 
> and exit
>
> Thanks in advance
>
> Abhi
>
>
>
> package main
>
> import "time"
> import "fmt"
>
> func main() {
>
> c1 := make(chan string)
> 
> go func() { //Sending data after certain time
>   
> c1 <- "result 1"
>
> time.Sleep(time.Second * 1)
> c1 <- "result 2 afer 1 sec"
>
> time.Sleep(time.Second * 1)
> c1 <- "result 2 afer 2 sec"
>
> time.Sleep(time.Second * 1)
> c1 <- "result 2 afer 3 sec"
>
> time.Sleep(time.Second * 1)
> c1 <- "result 2 afer 4 sec"
>
> time.Sleep(time.Second * 1)
> c1 <- "result 2 afer 5 sec"
> }()
>
> select {
> case <-time.After(time.Second * 4): { //cut off 4s and return the 
> value
> res := <-c1
> fmt.Println(res)  // expecting result "result 2 afer 3 sec" 
> but returning "result 1"
> }
> }
> }
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] go get and protos (protoc; grpc)

2017-07-29 Thread Timothy Raymond
I've used `go generate` and typically check in the generated *.pb.go. There's 
some formatting weirdness when contributers have different versions of the 
`protoc` binary, but nothing that causes anything to break.

-- 
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.
For more options, visit https://groups.google.com/d/optout.