Re: [go-nuts] Handshake failed when using builtin TLS package: no cipher suite supported by both client and server

2017-02-08 Thread Alexandr Emelin
Just tried trial certificate from Comodo - it works! So the problem is in Let's Encrypt issued certs. Having such a workaround solves my issue, many thanks for pointing me in right direction guys! среда, 8 февраля 2017 г., 21:09:00 UTC+3 пользователь cynexit.x написал: > > On 02/05/2017 09:44 AM

[go-nuts] Re: How to use embedded type to implement functional options for group of related types

2017-02-08 Thread Ron Evans
Thanks for the reply. Indeed the solution for what I was trying to do was to use the interface as the param, not a pointer to the concrete type. I had initially tried to pass a pointer to an interface which of course did not work. On Wednesday, February 8, 2017 at 11:12:54 PM UTC+1, Ron Evans w

Re: [go-nuts] Why can't interface parameters auto-convert types that implement that interface?

2017-02-08 Thread aindurti
Thought about this today, and although your argument is valid for the case where the function signature contains Node (like this) func (e E) Less(e2 Node) bool { return e.value < e2.value } the function signature presents a different type with Element func (e E) Less(e2 Element) bool { return e

[go-nuts] [ANN] Memo: take a note in CUI

2017-02-08 Thread mattn
Hi list. I wrote new app to take a note in CUI. This is smaller, easy, fast, pretty, seamless for taking notes. Moving the directory into local Dropbox may be useful. One of the feature, this can serve markdown files like jekyll. https://github.com/mattn/memo - mattn -- You received this me

[go-nuts] Re: Should a program always exit in main()?

2017-02-08 Thread 'Eric Johnson' via golang-nuts
On Tuesday, February 7, 2017 at 3:12:13 PM UTC-8, Francis Chuang wrote: > > I am working on a client library that starts a Kafka consumer to listen > for messages from a kafka stream and run some user defined handlers.* I > want the design to be "crash-only" as much as possible*, so will be >

Re: [go-nuts] How to use embedded type to implement functional options for group of related types

2017-02-08 Thread Ilya Kostarev
On 02/08/2017 10:55 PM, Ron Evans wrote: | packagemain import"fmt" type tableServer struct{ table int } type TableServerinterface{ SetTable(table int) GetTable()int } func NewTableServer()TableServer{ return&tableServer{} } func (i *tableServer)SetTable(table int){ i.table =table }

[go-nuts] How to use embedded type to implement functional options for group of related types

2017-02-08 Thread Ron Evans
I am trying to use an embedded type that implements an interface, in order to provide some functional options to a group of related types. However, I am receiving an error that I cannot use the embedded type to call the option function. Here is a contrived example. A type "Waiter" implements th

[go-nuts] Re: HTTP requests bottlenecks

2017-02-08 Thread emartinez1847
any idea? El miércoles, 1 de febrero de 2017, 23:26:07 (UTC-3), emarti...@gmail.com escribió: > > Hello, > > I'm writing a POC for a future RTB platform. Basically I'm doing stress > tests by receiving HTTP requests and performing HTTP GET requests in the > background. > > Issue I face is that

Re: [go-nuts] Handshake failed when using builtin TLS package: no cipher suite supported by both client and server

2017-02-08 Thread Christian von Pentz
On 02/05/2017 09:44 AM, Alexandr Emelin wrote: > Chrome 49 on Windows XP SP3 Are you using a cert from let's encrypt? There have been issues in the past (although LE officially lists Windows XP with SP3 as supported), check these links out: https://github.com/certbot/certbot/issues/1660 https:/

[go-nuts] Re: Measure/monitor Go CPU usage by garbage collector over time?

2017-02-08 Thread francis
I would also very much like to have access to this finer grained information. On Wednesday, January 11, 2017 at 11:55:34 PM UTC+1, Ian Rose wrote: > > Howdy, > > What's the best way to monitor the amount of CPU being consumed by a Go > server's GC? MemStats.GCCPUFraction doesn't really help bec

Re: [go-nuts] Re: Handshake failed when using builtin TLS package: no cipher suite supported by both client and server

2017-02-08 Thread James Bardin
Sorry, I'm not really sure what's going on here. Just to test, have you tried loading the cert temporarily without using autocert? You probably need to setup a system to reproduce this and get more info. I know there have been some issues in the past with WinXP and LetsEncrypt certs, though I don'

[go-nuts] [ANN] JSON encoder w/ support for runtime conditional field exclusion

2017-02-08 Thread Brian Wolter
Hey guys, I’ve written a drop-in replacement for the standard library JSON encoder which supports the conditional exclusion of fields at runtime based on an output role. Basically, it allows you to model a struct once and, for example, selectively exclude sensitive fields when it's sent to cer

Re: [go-nuts] *netFD.Close() will block in some case?

2017-02-08 Thread Ian Lance Taylor
On Tue, Feb 7, 2017 at 8:50 PM, wrote: > go version: 1.7.4 > OS: debian > code like: https://play.golang.org/p/DMIrSr2PLg > > this project just like IM, there are both goroutine for each client > connection, one to Read, another to Write. > recently i found conn.Close() (line 9) occasional block

[go-nuts] *netFD.Close() will block in some case?

2017-02-08 Thread liuding234
go version: 1.7.4 OS: debian code like: https://play.golang.org/p/DMIrSr2PLg this project just like IM, there are both goroutine for each client connection, one to Read, another to Write. recently i found conn.Close() (line 9) occasional block while high concurrency, then there are a large of

Re: [go-nuts] storing transaction in context

2017-02-08 Thread Sameer Ajmani
Historically we've insisted that the Context be passed explicitly so that it's always visible in the code and accessible to refactoring tools. In reality, tools that assist in context plumbing don't exist yet, and there are examples of putting Context inside some other structs in the standard libra

Re: [go-nuts] storing transaction in context

2017-02-08 Thread Henrik Johansson
The Context as "a bag of stuff" is attractive since it makes your code easier to refactor (knock, knock) but gives me void* or as Jakob said map[string]interface{} vibes. I think I think it should be avoided but probably not unconditionally. I guess there can be cases where it makes sense. ons 8

Re: [go-nuts] storing transaction in context

2017-02-08 Thread Jakob Borg
On 7 Feb 2017, at 03:57, Steven Roth wrote: > My question is whether putting the transaction in the context using > context.WithValue is a reasonable and appropriate use of that mechanism. If > not, why not? In my opinion, this is morally equivalent to a func Something(params map[interfac

[go-nuts] Re: storing transaction in context

2017-02-08 Thread Manlio Perillo
Il giorno martedì 7 febbraio 2017 03:57:25 UTC+1, Steve Roth ha scritto: > > I'd like input on whether the following idea is good or bad, and why. > > Consider an abstract transaction, modeled as follows: > func Transaction(ctx context.Context, body func(ctx context.Context) > error) error > Is T

Re: [go-nuts] Re: Should a program always exit in main()?

2017-02-08 Thread Christoph Berger
Well, I already thought that my suggestion seems somewhat too simple… :) I agree, if a fatal error occurs within a goroutine but you don’t want to crash the whole process from within this goroutine (or even from within the library), then error channels seem the way to go. > Am 08.02.2017 um 11:

Re: [go-nuts] Re: Should a program always exit in main()?

2017-02-08 Thread 'Axel Wagner' via golang-nuts
It's not uncommon to endless-loop until something goes wrong in such a case (see, for example, http.Serve ). Just return an error from Client.Start as suggested and then catch that in main and log.Fatal there. If a user of your library needs to do more code, they'l

Re: [go-nuts] Re: fmt: Why Golang doesn't have fmt.Printlnf?

2017-02-08 Thread Konstantin Khomoutov
On Wed, 08 Feb 2017 09:52:49 + Justin Israel wrote: > > fmt package have no *lnf method, but in other langs, > > sometimes it implements Printlnf. > > Is there any reason? > > yes, I know but other languages support it as default, isn't it? > *some* languages apparently do. But then again may

[go-nuts] Re: Should a program always exit in main()?

2017-02-08 Thread Francis Chuang
I made a mistake with my example. c.Start() needs to be a separate go routine because it is an infinite loop waiting for messages: go c.Start(). In that case, I am guessing an errors channel would be the best? Cheers, Francis -- You received this message because you are subscribed to the Googl

Re: [go-nuts] Re: fmt: Why Golang doesn't have fmt.Printlnf?

2017-02-08 Thread Justin Israel
On Wed, Feb 8, 2017, 4:32 PM 高橋誠二 wrote: > yes, I know but other languages support it as default, isn't it? > *some* languages apparently do. But then again maybe you could ask the opposite question to those languages. Why did these languages you refer to choose to implement a Printlnf? In said

[go-nuts] Re: Should a program always exit in main()?

2017-02-08 Thread Christoph Berger
To me, the simplest way seems to be to just return an error to the caller outside the library: func (c *Client) Start() *error* { for { select { case m := <-c.message: for _, handler := range c.handlers { err := handler(m) *if err != nil {* *return err* * }* } } } } On Wednesday, Februa

[go-nuts] Stor file by ftp ,but show error as "553 Could not create file"

2017-02-08 Thread Robert Hsiung
Hi all: I tried to Stor file by ftp ,but show error as "553 Could not create file". It is successful to use filezilla client,so ftp server is ok. Please give me some suggestions. Thanks so much. C:/Go/bin/go.exe build -i [F:/go/ftp_client] Success: process exited with code 0. F:/go/ftp_

[go-nuts] Re: Is there something wrong with performance of select in a for loop

2017-02-08 Thread fwang2002
If I use GOMAXPROCS=1, the result is acceptable. -- 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