Re: [go-nuts] Re: Having difficulty converting []byte to float

2018-05-18 Thread Michael Jones
yes, the example there is perfect: https://play.golang.org/p/QvPm90SUgiX On Fri, May 18, 2018 at 7:44 PM Tashi Lu wrote: > There is a function for this in the math lib Float64Frombits, a similar > question: >

[go-nuts] Re: Having difficulty converting []byte to float

2018-05-18 Thread Tashi Lu
There is a function for this in the math lib Float64Frombits, a similar question: https://stackoverflow.com/questions/22491876/convert-byte-array-uint8-to-float64-in-golang On Friday, 18 May 2018 10:31:11 UTC+8, John Fox wrote: > > Hello all. I am creating a custom exporter for FreeNAS >

[go-nuts] Re: Cgo: using syscall.Select

2018-05-18 Thread Juliusz Chroboczek
> You could also take a look > at https://godoc.org/github.com/mailru/easygo/netpoll I don't have a net.Conn, just a raw file descriptor. -- Juliusz -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

Re: [go-nuts] Load balancing with error feedback capabilities

2018-05-18 Thread Jakob Borg
That also means anyone else can call Lock() and Unlock() on your type. This is often not what you want, unless your type *is* a kind of lock (as opposed to *uses* a lock). On 18 May 2018, at 23:45, matthewju...@gmail.com wrote: By embedding I meant this: type

[go-nuts] Re: Load balancing with error feedback capabilities

2018-05-18 Thread matthewjuran
By embedding I meant this: type ServiceQProperties struct { ... sync.Mutex } which allows you to call p.Lock() instead of p.REMutex.Lock(). It’s just a personal preference that I was happy about when I learned about it. One thought here is you could make it a *sync.Mutex and not use a

[go-nuts] Re: Load balancing with error feedback capabilities

2018-05-18 Thread Ankit Gupta
Hi Matt, First of all, thanks so much for the review. I will revisit the package structure and take care of err handling in a more idiomatic way. Few points - - The mutex is embedded in model.ServiceQProperties. Here is the definition in model.balancer_properties.go - type

Re: [go-nuts] Having difficulty converting []byte to float

2018-05-18 Thread john . macrae . fox
After talking with a coworker it seems that "grep" returns a \n after its output. That was the bugger keeping my initial efforts from working. Grep was meant for "human consumption". I will need to look into buffio and scanner as Tamas suggested. On Friday, May 18, 2018 at 11:06:46 AM

Re: [go-nuts] Having difficulty converting []byte to float

2018-05-18 Thread john . macrae . fox
After talking with a coworker it seems that "grep" returns a \n after its output. That was the bugger keeping my initial efforts from working. On Friday, May 18, 2018 at 11:06:46 AM UTC-4, John Fox wrote: > > Drilling down farther for the heck of it > > os/exec/exec.go > func (c *Cmd) Output()

Re: [go-nuts] Having difficulty converting []byte to float

2018-05-18 Thread john . macrae . fox
Drilling down farther for the heck of it os/exec/exec.go func (c *Cmd) Output() ([]byte, error) { if c.Stdout != nil { return nil, errors.New("exec: Stdout already set") } var stdout bytes.Buffer c.Stdout = captureErr := c.Stderr == nil if captureErr { c.Stderr = {N: 32 << 10} }

[go-nuts] Re: Error getting FormValue in MultipartForm http request in Go 1.10

2018-05-18 Thread mosalovsv
answer from github: > Thank you for raising this issue. Unlike many projects on GitHub, the Go > project does not use its bug tracker for general discussion or asking > questions. We only use our bug tracker for tracking bugs and tracking > proposals going through the Proposal Process.

[go-nuts] Re: Load balancing with error feedback capabilities

2018-05-18 Thread matthewjuran
Hi Ankit, thanks for the Apache license and for sharing here. Here’s a code review. These are my unfiltered opinions and I hope that they are useful. Without looking at any code yet, the packages might not be idiomatic. Packages should contain specific behavior that can be decoupled from the

Re: [go-nuts] Error getting FormValue in MultipartForm http request in Go 1.10

2018-05-18 Thread Steven Hartland
Actually looks like its already fixed: https://github.com/golang/go/issues/24041 https://github.com/golang/go/commit/f69ad10377b1817e3db57851226a23973caa584e On 18/05/2018 13:06, mosalo...@gmail.com wrote: Hi! In version 1.9, I had no problem getting the FormValue in http request. After

Re: [go-nuts] Error getting FormValue in MultipartForm http request in Go 1.10

2018-05-18 Thread Steven Hartland
Do you have a little reproduction case you can put on playground? On 18/05/2018 13:06, mosalo...@gmail.com wrote: Hi! In version 1.9, I had no problem getting the FormValue in http request. After upgrading to version Go 1.10 of FormValue is empty. Did I find the error? in module:

[go-nuts] Re: Error getting FormValue in MultipartForm http request in Go 1.10

2018-05-18 Thread gary . willoughby
Maybe file an issue here?: https://github.com/golang/go/issues On Friday, 18 May 2018 13:55:00 UTC+1, Sergey Mosalov wrote: > > Hi! > In version 1.9, I had no problem getting the FormValue in http request. > After upgrading to version Go 1.10 of FormValue is empty. Did I find the > error? in

Re: [go-nuts] Having difficulty converting []byte to float

2018-05-18 Thread john . macrae . fox
Thank you both for the quick responses. I looked in to https://github.com/lovoo/ipmi_exporter yesterday and saw the TrimSpace used as well, but I am still not sure what is adding the '\n' to the commands's Output(). Tamas, I will have to look into thebuff IO, even if I am not using this for

[go-nuts] Error getting FormValue in MultipartForm http request in Go 1.10

2018-05-18 Thread mosalovsv
Hi! In version 1.9, I had no problem getting the FormValue in http request. After upgrading to version Go 1.10 of FormValue is empty. Did I find the error? in module: mine/multipart/formdata.go *before*: _, hasContentTypeHeader := p.Header["Content-Type"] if *!*hasContentTypeHeader && filename ==

[go-nuts] Load balancing with error feedback capabilities

2018-05-18 Thread Ankit Gupta
Hello gophers, I recently built a small HTTP load balancer with capabilities built around error feedback - https://github.com/gptankit/serviceq Provides two primary functionalities - deferred request queue and probabilitically reducing errored nodes selection. I am using channel as a in-memory