Re: [go-nuts] Extending image.Image with Set

2017-09-04 Thread James
I think your ImageSetter is already in the standard library https://golang.org/pkg/image/draw/#Image It's a little bit subtle because different packages have the immutable Image and mutable Image It might save you some work by using golang.org/x/image library which already has affine transforms. h

Re: [go-nuts] Problems with JSON Marshal/UnmarshalText aand maps

2017-11-27 Thread James
Think UnmarshalText needs to have a pointer receiver or you'll only be modifying a copy of the struct On 27 November 2017 at 23:13, Henrik Johansson wrote: > Hi, > > https://play.golang.org/p/bLiYSsKL_7 > > I have perhaps missed something simple or misunderstood the contract for > MarshalText/Un

Re: [go-nuts] How to implement In Golang

2016-09-19 Thread James
Try this tutorial: http://go-database-sql.org/ On 20 September 2016 at 03:42, kumargv wrote: > import MySQLdb > > conn = MySQLdb.Connect( > host='localhost', user='user', > passwd='secret', db='test') > cursor = conn.cursor() > cursor.execute("SELECT this,that FROM foobar") > rows = curs

Re: [go-nuts] Controlling VMware ESXi from Go

2016-07-21 Thread James
Take a look at govmomi -- works well with individual ESXi nodes. On Thu, Jul 21, 2016 at 20:11 Brad Fitzpatrick wrote: > If you have experience controlling VMware ESXi nodes from Go, could you > point me at recommended packages? Or API reference? > > Note: no vCenter, no vSphere management conso

Re: [go-nuts] Is it acceptable to make the optional parameter as varargs

2020-05-24 Thread James
This reminds me of functional options which I think are used quite widely for this purpose. See https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis and https://github.com/tmrts/go-patterns/blob/master/idiom/functional-options.md On Mon, 25 May 2020 at 14:57, Amarjeet Anand w

Re: [go-nuts] Re: A peculiar sort problem

2021-07-27 Thread James
It could be that .NET is using some locale based collation. Seems like a lot of machinery, but might do the trick https://pkg.go.dev/golang.org/x/text@v0.3.6/collate On Wed, 28 Jul 2021 at 06:52, jake...@gmail.com wrote: > Personally I would be careful about assuming that was the only sorting >

Re: [go-nuts] cgo binding copies data twice, necessary?

2022-08-23 Thread James
Assuming that `p.privateKey = *((*C.private_key)(key))` is making a full copy, not shallow. I think you could avoid using `C.CBytes`. You can get the address of the start of the backing array via &data[0] as per https://pkg.go.dev/cmd/cgo So maybe something like this: p.privateKey = *((*C.private

Re: [go-nuts] fs.Glob, fs.DirWalk, etc. does the pattern support complex regex

2022-11-03 Thread James
It makes the pattern a bit ugly, but you can definitely do it with path.Match https://go.dev/play/p/zi6nh8Vj9LF On Fri, 4 Nov 2022 at 09:20, pat2...@gmail.com wrote: > This has to be a FAQ, but my google foo for searching it is not clear > The docs say: " The syntax of patterns is the same as in

[go-nuts] High precision timer data?

2018-03-01 Thread James Chacon
and use that as a baseline for determining how much to sleep? i.e. effectively a mini benchmark on startup to determine local machine average run time and assume some slop? James -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe f

Re: [go-nuts] High precision timer data?

2018-03-01 Thread James Chacon
On Thu, Mar 1, 2018 at 10:13 AM, Ian Lance Taylor wrote: > On Thu, Mar 1, 2018 at 8:56 AM, James Chacon > wrote: > > > > I know the time package includes support for using the cycle timer on the > > machine (if available) to get high precision monotonic time measurement

Re: [go-nuts] High precision timer data?

2018-03-02 Thread James Chacon
On Thu, Mar 1, 2018 at 11:07 PM, James Chacon wrote: > > > On Thu, Mar 1, 2018 at 10:13 AM, Ian Lance Taylor wrote: > >> On Thu, Mar 1, 2018 at 8:56 AM, James Chacon >> wrote: >> > >> > I know the time package includes support for using the cycle time

Re: [go-nuts] High precision timer data?

2018-03-03 Thread James Chacon
On Thu, Mar 1, 2018 at 11:59 PM, James Chacon wrote: > > > On Thu, Mar 1, 2018 at 11:07 PM, James Chacon > wrote: > >> >> >> On Thu, Mar 1, 2018 at 10:13 AM, Ian Lance Taylor >> wrote: >> >>> On Thu, Mar 1, 2018 at 8:56 AM, James Chacon &

Re: [go-nuts] High precision timer data?

2018-03-04 Thread James Chacon
. Reading code it looks like it parks the goroutine for X time and I'm doubting scheduling latency is down in the low nanoseconds right now. So either simulating using something known with low cost (like back/back time.Now() calls) or invoking inlined assembly it looks like. James On Sat,

Re: [go-nuts] High precision timer data?

2018-03-06 Thread James Chacon
I have a hard time believing that will have anywhere near < 100ns granularity considering time.Sleep has microsecond only in testing. James On Mon, Mar 5, 2018 at 5:00 AM, Frederic Landais wrote: > Hello, > > have you considered using time.NewTicker > <https://golang.org/p

[go-nuts] Re: Go routines hanging

2018-05-05 Thread James Bardin
On Saturday, May 5, 2018 at 6:27:54 AM UTC-4, s...@whites.team wrote: > > debug.SetGCPercent(-1) > stops the issue occurring - so I think we're onto a winner with the > garbage collection idea! Is there something I'm doing wrong that is causing > this GC binning off all of my go routines? >

[go-nuts] Re: Go routines hanging

2018-05-05 Thread James Bardin
On Saturday, May 5, 2018 at 9:30:25 AM UTC-4, s...@whites.team wrote: > > Hi James, > > Thanks for the tip - could you elaborate on your idea of a 'busy loop'? Is > this a loop that is blocked, or just one that is currently operating on > something? I'm

[go-nuts] Help debugging atomic.AddInt64 usage

2018-08-02 Thread James Hartig
We are having a weird case where an atomic number was increasing and not decreasing, despite calls to decrease it. Hopefully, someone on the list can point out something I'm doing wrong with the atomic package. The function with the issue is: func UnhealthyOverConcurrent(prefix string, limit in

[go-nuts] Re: Local cache of dependencies

2018-08-23 Thread James Warren
on. Cheers, James On Wednesday, August 22, 2018 at 11:34:14 PM UTC+1, Conor Hackett wrote: > > Hey Guys, > > So, adding your "vendor" directory to SCM is a contentious topic at best. > > I personally would rather not vendor the dependencies but I do need to >

[go-nuts] Re: go language sensitive editor?

2018-11-23 Thread Jeremiah James
A vote for Goland from me. -- 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

[go-nuts] Re: Strange behaviour of left shift

2018-12-05 Thread James Bardin
On Wednesday, December 5, 2018 at 11:36:32 AM UTC-5, Michel Levieux wrote: > > which I assume works pretty well. But if I do the same in a test main and > try to 'go run' it, with this line : > > const v = 1 << 64 - 1 >> >> > I get the following error : > > ./testmain.go:8:13: constant 184467440

Re: [go-nuts] Strange behaviour of left shift

2018-12-05 Thread James Bardin
On Wednesday, December 5, 2018 at 11:55:25 AM UTC-5, Michel Levieux wrote: > > Well the only thing I do in the main is : > > fmt.Println(v) >> > > Shouldn't the compiler statically type v to uint64? > I don't get the need to force type of v to uint64? > > Nope. You're passing an untyped constant

[go-nuts] Re: HTTP/2 multiplexing

2017-07-30 Thread James Abley
On Thursday, 13 July 2017 15:56:27 UTC+1, pala.d...@gmail.com wrote: > > Hello, I'm trying to understand how to write an HTTP client using the > standard HTTP package and which takes advantage of HTTP/2 multiplexing > (i.e. send many requests "in parallel" using the same TCP connection). > > On

Re: [go-nuts] Re: HTTP/2 multiplexing

2017-08-02 Thread James Abley
A goroutine making each request, passing in the http.Client should work. Something like http://blog.narenarya.in/concurrent-http-in-go.html On Wed, 2 Aug 2017 at 18:58 wrote: > Parallel in the sense of HTTP/2 multiplexing, i.e. sending the next > request without having to wait for the reply of

[go-nuts] Re: runtime.GOOS case

2017-08-07 Thread James Bardin
They will always be lowercase, as the values are all defined in the code const GOOS = `android` const GOOS = `darwin` const GOOS = `dragonfly` const GOOS = `freebsd` const GOOS = `linux` const GOOS = `nacl` const GOOS = `netbsd` const GOOS = `openbsd` const GOOS = `plan9` const GOOS = `solaris` co

[go-nuts] Re: Go 1.9 introduced error on UDP Multicast JoinGroup

2017-08-28 Thread James Bardin
On Sunday, August 27, 2017 at 7:36:22 PM UTC-4, oldCoderException wrote: > > No. I just downloaded and used 1.9 on its release last week. I've > reverted to 1.8.3 for now and, as mentioned, it's working fine for me. > > >>> Are you certain you also have the latest version of golang.org/x/net/i

Re: [go-nuts] go env GOPATH not reflecting $GOPATH

2017-08-31 Thread James Bardin
On Thursday, August 31, 2017 at 9:46:11 PM UTC-4, burpswangy wrote: > > Wow, actually... that did work. I was using 'set GOPATH' and not 'export > GOPATH'. I have GOPATH defined in my /etc/bash.bashrc... is there anywhere > else I should be putting it? > >> >>> You should be using a profile f

[go-nuts] Re: net: unclear how to confirm synchronously that a net.TCPListener is closed

2017-09-11 Thread James Bardin
On Monday, September 11, 2017 at 5:53:10 AM UTC-4, Shivaram Lingamneni wrote: > > > 1. Using `Listener.Close()` to interrupt the `Listener.Accept()` call > on the other goroutine > 2. Using a channel to tell the other goroutine that it should call > `Listener.Close()` itself and exit > 3. Us

[go-nuts] Re: How to run escape analysis on subpackage

2017-09-14 Thread James Bardin
On Thursday, September 14, 2017 at 10:58:27 AM UTC-4, Diego Medina wrote: > > > go build -gcflags "-m -m" github.com/me/project-name/packagea and nothing > prints out, > > > Nothing printed because it was already installed. You could update the timestamp on any of the package files, remove the

[go-nuts] Re: Why bytes Buffer's ReadFrom method blocked when read from a UDP connection?

2017-09-20 Thread James Bardin
You shouldn't use bufio around a UDP connection. The reads are a fixed size, so there's no "batching" of reads that could happen, and you can't do a partial read of a UDP packet, so you're going to lose data as soon if the buffer attempts to top off with a read smaller than the next packet size

[go-nuts] Re: Should net.Conn transform function retain the original data segmentation?

2017-11-20 Thread James Bardin
Dave, should I then file a bug against net.UDPConn? ;) Though in this case I assume you must be using a TCP connection, so there is no concept of a "message" and hence to direct connection between the write size and the read size. If something other than UDP is expecting the full message in a s

Re: [go-nuts] Re: Should net.Conn transform function retain the original data segmentation?

2017-11-20 Thread James Bardin
On Mon, Nov 20, 2017 at 12:01 PM, James Bardin wrote: > Though in this case I assume you must be using a TCP connection, so there > is no concept of a "message" and hence to direct connection between the > write size and the read size. If something other than UDP is expecting

[go-nuts] Re: What does the 1st :8 do in -- slice := (*[1 <<

2017-12-13 Thread James Bardin
On Wednesday, December 13, 2017 at 8:49:07 AM UTC-5, M.P. Ardhanareeswaran wrote: > > var i uint64 = 0xdeedbeef01020304 >> >> slice := (*[1 << 30]byte)(unsafe.Pointer(&i))[:8:8] >> >> The fist 8 is the length, and the second is capacity. See "Full Slice Expressions" specification here: https://

[go-nuts] Re: Why does http client try to connect via IPv6 address when IPv6 is not enabled on machine

2018-01-02 Thread James Bardin
The net dialer sorts the addresses according to RFC6724, which means that since you don't have ipv6 enabled they go to the end of the list, but doesn't remove them entirely. Also if you're using the DefaultTransport from the net/http package, it has DualStack enabled which means that ipv4 and i

Re: [go-nuts] SIGSEGV during build of Go from source

2018-01-15 Thread James Waldrop
Aha, I did. I was cross compiling. Thank you! On Mon, Jan 15, 2018 at 2:27 PM Ian Lance Taylor wrote: > On Mon, Jan 15, 2018 at 1:43 PM, wrote: > > > > My bootstrap Go is a 1.9.2 binary, and I'm trying to compile Go on High > > Sierra (MacOS 10.13.2). > > > > I get a SIGSEGV during test run: >

Re: [go-nuts] SIGSEGV during build of Go from source

2018-01-15 Thread James Waldrop
Just to confirm, this indeed fixed things. Thanks for the quick response! On Mon, Jan 15, 2018 at 2:31 PM, James Waldrop wrote: > Aha, I did. I was cross compiling. Thank you! > > On Mon, Jan 15, 2018 at 2:27 PM Ian Lance Taylor wrote: > >> On Mon, Jan 15, 2018 a

[go-nuts] Go as your first language

2018-01-15 Thread James Pettyjohn
on the subject often expects a knowledge of another language. Are there tracks of knowledge to take someone from 0 to understanding baseline knowledge? And from there through taking them to a professional grade standard? Best, James -- You received this message because you are subscribed to t

[go-nuts] if i catch resp.StatusCode != http.StatusOK and return early from my function, do i still have to close resp.Body??

2018-01-28 Thread James Bardin
Yes, always close the body in order to ensure the network connection is released. If you want to be able to reuse the connection, you should attempt to consume the body as well. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe fr

[go-nuts] How do you keep your modules up-to-date?

2019-05-30 Thread James Hartig
What's the best way to automatically always pull the latest release/commit for certain repos? We use gerrit internally so all of our import paths for internal packages start with something like gerrit.corp. We have over 50 different repos and it would be painstaking to have to update (pull lates

Re: [go-nuts] How do you keep your modules up-to-date?

2019-05-30 Thread James Hartig
ounds like you've got that solved. > > -- Marcin > > On Thu, May 30, 2019 at 7:55 AM James Hartig > wrote: > >> What's the best way to automatically always pull the latest >> release/commit for certain repos? We use gerrit internally so all of our >> imp

[go-nuts] Parsing go.mod

2019-09-02 Thread James Pettyjohn
Hi, This might be a bad idea but I'm trying to parse the go.mod file for data as part of my build process - if at all possible I'd like to avoid duplicating the data that is already there in another file. Is there an exposed package that can be used for this? - J -- You received this message

Re: [go-nuts] Parsing go.mod

2019-09-03 Thread James Pettyjohn
Thanks. I saw the same being done by vgo - might be viable. On Monday, September 2, 2019 at 10:52:45 PM UTC-7, kortschak wrote: > > Not really exposed, but there is code you could copy. > > https://golang.org/pkg/cmd/go/internal/modfile/#Parse > > On Mon, 2019-09-02 at

Re: [go-nuts] Parsing go.mod

2019-09-03 Thread James Pettyjohn
times, total hack, but works). Best, James On Monday, September 2, 2019 at 10:58:53 PM UTC-7, Kurtis Rader wrote: > > On Mon, Sep 2, 2019 at 10:44 PM James Pettyjohn > wrote: > >> This might be a bad idea but I'm trying to parse the go.mod file for data >> as part of my

Re: [go-nuts] Parsing go.mod

2019-09-03 Thread James Pettyjohn
efore running protoc (that has been asked quite a few times, >> total hack, but works). >> >> go list -f {{.Version}} -m example.com/blah >> >> Note that if you have a replace directive for example.com/blah then >> the replace target might have a version. >&

Re: [go-nuts] Parsing go.mod

2019-09-03 Thread James Pettyjohn
nd get JSON output. > > go help mod edit > > will given you the types you can then use to unmarshal the JSON. > > Failing that, the code that Dan referenced has been factored out into: > > https://godoc.org/github.com/rogpeppe/go-internal/modfile > > On Tu

[go-nuts] Marshaling structs to command line arguments

2019-09-11 Thread James Pettyjohn
Hi, While not the most likely of scenarios, I'm having to write a lot of integration around existing command line tools and want a better way then passing strings/constants around. While there are ample choices to go from command line arguments to structs etc, I'm not finding anything besides

[go-nuts] Re: Search for Another JSON Package

2016-08-24 Thread James Bardin
Can you use the json.Number type? https://play.golang.org/p/pKZeDJHkKK On Wednesday, August 24, 2016 at 5:30:10 AM UTC-4, dc0d wrote: > > Is there a JSON package that have these characteristics? > > >- can marshal numeric integer values to strings (like >using `json:",string"` tag) >

Re: [go-nuts] Re: net.Conn.Write is failing in golang

2016-08-26 Thread James Bardin
On Fri, Aug 26, 2016 at 5:46 AM, wrote: > I found it's hard to match *this particular error (*"broken pipe"*)*, and > handle it accordingly, is there a solution? > What do you want to do with this particular error? How would you handle it differently than any other permanent error? The error i

Re: [go-nuts] Cgo Pointer Arithmetic

2016-09-01 Thread James Bardin
On Thursday, September 1, 2016 at 8:45:02 AM UTC-4, Luke Mauldin wrote: > > After I added the unsafe.Pointer conversion the code compiled: > https://play.golang.org/p/QTPyhZzKZH > > So my understanding is that line 15 is jut a pointer type conversion to > slice that is backed by the C array, so

[go-nuts] Re: Speeding up Go Report Card

2016-09-05 Thread James Aguilar
On Friday, September 2, 2016 at 6:50:58 AM UTC-7, Shawn Smith wrote: > > Hi, > > I'm one of the maintainers of Go Report Card http://goreportcard.com/ and > I am looking for advice on how to make it faster. > > Basically we run a series of checks (gofmt, vet, etc.) on your Go > repository and pro

[go-nuts] C.dll callback golang func will stuck

2016-09-09 Thread James Bardin
You have a busy loop in main. Use another method to block, like a read in stdin, wait for a signal, etc. -- 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-

[go-nuts] go get creating strange git messages in bash. Any ideas what causes this ?

2016-09-15 Thread James Bardin
You have a few repos that aren't on a branch, so git can't pull and fast forward. You can checkout master in those repos, or delete them altogether and the next `go get` will fetch the current master branch. -- You received this message because you are subscribed to the Google Groups "golang-

Re: [go-nuts] go get creating strange git messages in bash. Any ideas what causes this ?

2016-09-15 Thread James Bardin
On Thu, Sep 15, 2016 at 5:53 PM, Joe Blue wrote: > thanks James > > You lost me here. > Where's here? O can try to provide more detail if you let me know what you're not following. If you go into each repo that's not working and checkout master, "go get -u&quo

[go-nuts] How example can be run in test?

2016-09-16 Thread James Bardin
This is fixed in master. In go1.7 the Examples and Benchmarks aren't run if there are no Test functions. -- 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-

[go-nuts] Re: net/http: In the infinite loop, refused all requests.

2016-09-19 Thread James Bardin
A busy loop is always a programming error, and there's no reason to do this is your code. If you actually did have a loop with no function calls that's somehow useful, you could add occasional calls to runtime.Gosched() to yield to the scheduler. -- You received this message because you are

[go-nuts] Re: http ssl "can't identify protocol"

2016-09-20 Thread James Bardin
It would really help if we had some complete code to reproduce the issue. It sounds like the server isn't closing connections, but with only these simple handlers I don't see where that could happen. Are there any Hijack calls, x/net/ipv4, or network related syscalls anywhere in your code? Doe

Re: [go-nuts] CGO: Go string -> void*/length

2016-10-31 Thread James Bardin
C.CBytes does essentially this, but you either need to start with a []byte, or the string conversion could be a second copy. I don't see a need for a separate version CString without the null when you can just pass the length-1. In the rare case that the extra byte makes a difference, you coul

[go-nuts] Re: Concurrently read map entries into a channel

2016-11-06 Thread James Bardin
On Sunday, November 6, 2016 at 12:00:33 AM UTC-4, Keith Randall wrote: > > > You cannot modify the map in another goroutine while iterating. Iterating > is considered a read operation for the entire duration of the read. Writes > happening simultaneously with reads are a data race. > "Entire

[go-nuts] Concurrent map error in net/http/trasport

2016-11-10 Thread James Pettyjohn
I ran into this on go 1.6.2 amd64, seems unlikely this is a core issue and I need to look else where in the project but has anyone seen this before? fatal error: concurrent map read and map write goroutine 21619 [running]: runtime.throw(0xfefc00, 0x21) /usr/local/go/src/runtime/panic.go:

[go-nuts] Re: httputil.ReverseProxy adding 100+ ms of latency on localhost - any ideas?

2016-11-17 Thread James Bardin
While it might not be the initial problem, you're creating a new proxy and a new http.Transport on every request. At the end of that request that transport will probably still contain the open connection which you can no longer use. That's going to tie up the FD until the keepalive can kill it

Re: [go-nuts] Re: httputil.ReverseProxy adding 100+ ms of latency on localhost - any ideas?

2016-11-17 Thread James Bardin
On Thu, Nov 17, 2016 at 5:47 PM, Tom wrote: > I agree that creating a ReverseProxy object every time is inefficent with > regards to transports - but surely that wouldnt cause the additional > latency? Depends on what exactly you're measuring and how you're testing. A DNS query, TCP connect, o

[go-nuts] Re: http.NewRequest stopped to check SSL certificate validity every time

2016-11-19 Thread James Bardin
Chances are that you're getting better reuse of the client connections. If you want to ensure that you reconnect periodically use Request.Close when you don't want the connection maintained, or call Transport.CloseIdleConnections occasionally between requests to force the connections to close.

Re: [go-nuts] Re: http.NewRequest stopped to check SSL certificate validity every time

2016-11-19 Thread James Bardin
On Sat, Nov 19, 2016 at 11:33 AM, Vasily Korytov wrote: > It stays there for days, so I'm not sure. And the client is supposed to be > created and destroyed in a function that terminates, so I'm really > surprised by that. > > The connection can stay there for as long as the server and client wan

[go-nuts] Re: [Help] In a multi-threads application, when main function spins, the whole application hangs up

2016-11-21 Thread James Bardin
On Monday, November 21, 2016 at 2:23:37 PM UTC-5, zhaoguo wang wrote: > > Hi all, > > I wrote a simple application: the main function creates two goroutines, > while these two goroutines use RPC to do simple communication continually. > > I found > *if the main function falls into a busy loop a

Re: [go-nuts] Deleting the /r/golang subreddit

2016-11-24 Thread James Aguilar
Another vote for temperance here. The CEO making a scumbag move that affected a tiny handful of posts seems barely related to deleting a subreddit. If some folks don't want to support Reddit, that seems reasonable. It seems less reasonable to disrupt a community without that community's consent.

[go-nuts] Re: net/http and errors.

2016-11-28 Thread James Bardin
If you want to assert your way down to the original error, the order of the structures returned from http.Get is: if err, ok := err.(*url.Error); ok { if err, ok := err.Err.(*net.OpError); ok { if err, ok := err.Err.(*net.DNSError); ok { fmt.Println("DNS ERROR:", err) } } } Again though, the act

[go-nuts] Re: net.Conn.Read() performance

2016-12-01 Thread James Bardin
Conn.Read is a much higher level construct the using the syscalls directly. The largest part of the overhead is coordinating with the network poller. There's also a slight overhead of using the net.Conn interface, so asserting the value to a *net.TCPConn may save you a little (though I'm not

[go-nuts] Re: Downloading go1

2016-12-01 Thread James Bardin
Can you build it from source? The repo of course contains the entire history. On Thursday, December 1, 2016 at 4:57:30 PM UTC-5, freeformz wrote: > > For $reasons I need to download the original linux amd64 version of go1. > > Older go versions are stored under > https://storage.googleapis.co

[go-nuts] Re: ANN: A HTTP backed File System (FUSE)

2016-12-05 Thread James Mills
@Ben: WebDAV is quite a valid choice indeed. I chose to do this project to a) continue to learn and become proficient at Go and b) I wanted something I could fuse mount and curl with a simple api. cheers James James Mills / prologic E: prolo...@shortcircuit.net.au W

Re: [go-nuts] ANN: A HTTP backed File System (FUSE)

2016-12-06 Thread James Mills
suitable for load balancing... > Pretty sure you could stick a load balancer in front of back httpfsd backends and point httpfsmount at the lb? I haven't tried this yet :) File an issue let's make that work. cheers James -- You received this message because you are subscribed to t

[go-nuts] Responsive boxes in go-gtk

2016-12-13 Thread James Ralphs
I'm writing a desktop application using the Go bindings for GTK at https://mattn.github.io/go-gtk/. I'm showing a set of widgets in a listing "view". I'd like to make it responsive - kind of like using the "float" property in CSS. So far I've looked at VBox, HBox, Table, and the Fixed Layout an

[go-nuts] Statically linking cgo

2016-12-24 Thread James Pettyjohn
I've been looking at a number of articles on statically linking go files by disabling CGO, sounds great except I've got a libsass dependency until the native libsass is ready. Can this be in a straightforward manner with go 1.6/1.7 on linux (centos)? -- You received this message because you ar

Re: [go-nuts] Statically linking cgo

2016-12-24 Thread James Pettyjohn
is not an option at this time. Best, James On Saturday, December 24, 2016 at 5:36:48 PM UTC-8, Justin Israel wrote: > > > > On Sun, Dec 25, 2016 at 9:22 AM James Pettyjohn > wrote: > >> I've been looking at a number of articles on statically linking go files >&g

[go-nuts] Re: How to close all existing connections on http server

2017-01-03 Thread James Bardin
Up until now you had to implement that yourself. In go1.8 the http.Server will have Close and Shutdown methods: - https://tip.golang.org/pkg/net/http/#Server.Close - https://tip.golang.org/pkg/net/http/#Server.Shutdown On Tuesday, January 3, 2017 at 10:52:29 AM UTC-5, laxman.v...@gmail.com w

[go-nuts] Re: http/2 client vs. GOAWAY

2017-01-12 Thread James Bardin
Form the SO link the frame was sent with ErrCode=NO_ERROR, which I would assume would be handled silently by the transport. Not ruing out the ALBs doing something strange, but I would open an issue none the less. On Wednesday, January 11, 2017 at 5:18:54 PM UTC-5, Brian Fallik wrote: > > Hel

[go-nuts] func return with if... else...

2017-01-14 Thread James Bardin
If you're "if" block returns, and there's nothing after the "else" block, then you don't need the "else" at all. -- 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

Re: [go-nuts] HTTP Server - Force close connection after response

2017-01-17 Thread James Bardin
No, it signals to the client that the connection will be closed after the completion of the response. -- 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-nut

Re: [go-nuts] HTTP Server - Force close connection after response

2017-01-17 Thread James Bardin
ll do the right thing. On Tuesday, January 17, 2017 at 7:06:44 AM UTC-5, James Bardin wrote: > > No, it signals to the client that the connection will be closed after the > completion of the response. -- You received this message because you are subscribed to the Google Groups "golan

[go-nuts] Help creating a github.com/mattn/go-gtk/gtk.Image from image.Image?

2017-01-18 Thread James Ralphs
Hi, I'm trying to create an gtk.Image from a Go image.Image (or similar, image.RGBA would be fine too), and am stuck. It looks like I need to create a gdk.Pixbuf to feed to the GTK image widget, but I can't figure out how to use the gdk.Pixbuf, to create a useful picture. All the examples of h

[go-nuts] Foregrounding, process management, os/exec.Cmd

2017-01-21 Thread James Aguilar
If you don't know or care about pagers and process management, you can stop reading now. *Background:* I have a program that compile my code each time I modify it. It produces logs continuously on a terminal. I'm trying to write a go program to wrap this program so that each compile log is op

Re: [go-nuts] Segmentaion fault / static binary

2016-07-18 Thread James Bardin
FWIW, the "github.com/xeodou/go-sqlcipher" library isn't being linked correctly, and it seems to be trying to load /lib/x86_64-linux-gnu/libcrypto.so at runtime. Not sure what's at fault off hand, but "github.com/xeodou/go-sqlcipher" might be making some assumptions about being dynamically lin

[go-nuts] Re: howto kill pipe process using gopkg.in/pipe.v2

2016-07-18 Thread James Aguilar
State.Kill looks promising. On Monday, July 18, 2016 at 10:39:36 AM UTC-7, Walter Garcia wrote: > > Hello. > > Im using pipe.v2 and work fine, but I need cancel the process running, How > can I do it? > > The process is running, but in certain circu

[go-nuts] [ANN] Legit Input Validation

2016-07-22 Thread James Cunningham
Hey Gophers! Today I released my library to help with user input validation, called Legit. I would appreciate any and all feedback. The difference between existing libraries which tend to use struct tags, Legit defines an interface requiring types have a method called `Validate` and exposes he

[go-nuts] Re: ANNOUNCE: gini

2016-07-23 Thread James Pirruccello
This seems incredibly useful. I wonder if you'd consider creating an example project as a demonstration, showing what import path we should be using and very basic operation -- I think it would help get interested people onboard quickly. Thanks for considering! - James On Saturday, Ju

[go-nuts] Re: Someone reads req.Body even after client.Do ends in an http request,

2016-07-25 Thread James Bardin
To put it another way, excluding error conditions, the request isn't done until you've consumed the response body and closed it. On Monday, July 25, 2016 at 3:11:01 PM UTC-4, fabian@gmail.com wrote: > > Hi, > > first, two points on the more obvious aspects: > >- The ContentLength header

[go-nuts] Re: http response issue with leaking handles

2016-07-28 Thread James Bardin
On Thursday, July 28, 2016 at 2:40:38 AM UTC-4, krma...@gmail.com wrote: > > resp, err := http.Get("https://api.ipify.org?format=json";) if resp != nil > { defer resp.Body.Close() } > > This is incorrect. There's no guarantee that a non-nil Response contains a non-nil Body after an error. re

Re: [go-nuts] Re: http response issue with leaking handles

2016-07-28 Thread James Bardin
On Thu, Jul 28, 2016 at 10:39 AM, Ian Davis wrote: > Is it? The http package only says: > > "When err is nil, resp always contains a non-nil resp.Body. Caller should > close resp.Body when done reading from it." > > It doesn't say anything about the case where err != nil > > On error, any Respon

Re: [go-nuts] Re: http response issue with leaking handles

2016-07-28 Thread James Bardin
On Thu, Jul 28, 2016 at 11:08 AM, Ian Davis wrote: > Great. Very clear. > > To those looking for this: it's a new comment added after 1.6.2 > Thanks, forgot I was on master. Yes, this was implied by the error handling example in the docs, but now is much more explicit. -- You received this me

Re: [go-nuts] Re: http response issue with leaking handles

2016-07-28 Thread James Bardin
ady closed" > > I am interested in looking at it. I didnt find it here > https://golang.org/pkg/net/http/ > > > On Thursday, July 28, 2016 at 8:10:30 AM UTC-7, James Bardin wrote: >> >> >> On Thu, Jul 28, 2016 at 11:08 AM, Ian Davis wrote: >> >

Re: [go-nuts] Re: http response issue with leaking handles

2016-07-29 Thread James Bardin
On Fri, Jul 29, 2016 at 2:01 AM, wrote: > Thanks James, are there any golang tools which could have caught this > issue. I know go vet didnt. Caught the issue of using the first odd pattern for closing the response Body? There's no tool that can detect general logic errors in y

[go-nuts] Re: Server response time hike.

2016-07-29 Thread James Bardin
The open connections are either totally irrelevant, or are the _result_ of whatever is causing the response time to increase. Are you setting a reasonable ReadTimeout and WriteTimeout on your server? Maybe slow/stalled clients are holding server resources? On Friday, July 29, 2016 at 10:22:51

[go-nuts] Re: how to apply netutil.LimitListener() to ListenAndServeTLS()'s listener? how to fetch ListenAndServeTLS()'s listener?

2016-08-03 Thread James Bardin
The issue here in essence is that an http.Server doesn't store a new.Listener to expose, it only operates on one provided to the Serve method. Without changing the api, there's no way to expose a listener in an http.Server in a way that doesn't interfere with the other methods. However, I also

Re: [go-nuts] Is there a function in standard lib to convert []T to a []interface{}?

2016-08-03 Thread James Bardin
https://github.com/golang/go/issues/15209 On Wednesday, August 3, 2016 at 11:20:01 AM UTC-4, T L wrote: > > > > On Wednesday, August 3, 2016 at 10:53:34 PM UTC+8, Jessta wrote: >> >> On 4 Aug 2016 12:36 a.m., "T L" wrote: >> > >> > Often, I need converting a []T to []interface{} to use the []inte

[go-nuts] Re: Go package management proposal process

2016-08-05 Thread James Pirruccello
I'd be happy to second your nomination. On Saturday, August 6, 2016 at 12:58:48 AM UTC-4, Dave Cheney wrote: > > Hello, > > I wish to nominate myself to be part of the working group. I have written > up my position statement here: > > https://gist.github.com/davecheney/48c07d20f8cf38cce61c940d7bd

[go-nuts] Re: Shouldn't net/http Client.Do() return EOF when a connection is closed?

2016-08-08 Thread James Bardin
If you look at the type of the error returned, it's probably a *url.Error. In that case you case you can get the original error from the network read in the Err field. Something like: if err, ok := err.(*url.Error); ok { if err.Err == io.EOF { log.Fatal("received io.EOF during request") } }

[go-nuts] Increase speed of repeated builds

2016-08-11 Thread James Pettyjohn
I have a project which has become fairly large, I simple check of *.go, no _test files (including all modules), it's up to 1300 files. The main module though is 60 files, about 1MB of go source. It is taking to about 20 seconds to compile for a single change in the main module using go 1.6.2 d

Re: [go-nuts] Increase speed of repeated builds

2016-08-11 Thread James Pettyjohn
I noticed that in the release notes, I'll try out the RC and see what it gives me. On Thursday, August 11, 2016 at 8:09:55 PM UTC-7, Michael Hudson-Doyle wrote: > > On 12 August 2016 at 15:01, James Pettyjohn > wrote: > > I have a project which has become fairly large, I

[go-nuts] Re: Increase speed of repeated builds

2016-08-11 Thread James Pettyjohn
Maybe I wasn't clear, I am not sure what else to look at in this scenario. Whatever details you have in mind, i.e. which ones are relevant, is what I'm missing. On Thursday, August 11, 2016 at 8:16:38 PM UTC-7, Dave Cheney wrote: > > Can you please post some details. -- You received this mess

Re: [go-nuts] Increase speed of repeated builds

2016-08-11 Thread James Pettyjohn
I tried using 1.7rc6, no issues in compilation but finishes only about half a second under 1.6.2. On Thursday, August 11, 2016 at 8:19:12 PM UTC-7, James Pettyjohn wrote: > > I noticed that in the release notes, I'll try out the RC and see what it > gives me. > > On Thursday

[go-nuts] Re: Increase speed of repeated builds

2016-08-12 Thread James Pettyjohn
Here we go: WORK=/var/folders/j7/4pq3fms94f16lq7sljs3gd1cgp/T/go-build579975441 site_www2 mkdir -p $WORK/site_www2/_obj/ mkdir -p $WORK/site_www2/_obj/exe/ cd /Users/jp/git/project/src/site_www2 /usr/local/go/pkg/tool/darwin_amd64/compile -o $WORK/site_www2.a -trimpath $WORK -p main -complete

[go-nuts] Re: Increase speed of repeated builds

2016-08-14 Thread James Pettyjohn
t 2016 08:01:19 UTC+10, James Pettyjohn wrote: >> >> Here we go: >> >> WORK=/var/folders/j7/4pq3fms94f16lq7sljs3gd1cgp/T/go-build579975441 >> site_www2 >> mkdir -p $WORK/site_www2/_obj/ >> mkdir -p $WORK/site_www2/_obj/exe/ >> cd /Users/jp/git/

  1   2   >