Yep. My understanding of locking the OS thread from an init() was wrong. I
think I have it working now. Thanks guys!
On Tue, Dec 17, 2019, at 9:37 AM, Ian Davis wrote:
>
>
> On Sat, 14 Dec 2019, at 7:51 PM, bucha...@gmail.com wrote:
>> If I understand correctly, that would prevent me from
This panic has caused me trouble many times over the last year:
panic: http: multiple registrations for /debug/requests
goroutine 1 [running]:
net/http.(*ServeMux).Handle(0x5c47ba0, 0x511cbc5, 0xf, 0x5223160, 0x515f730)
/usr/local/go/src/net/http/server.go:2353 +0x239
I created a simple utility to build release notes based on github pull
request history, if anyone finds it
useful: https://github.com/buchanae/github-release-notes
Example results: https://github.com/ohsu-comp-bio/funnel/releases/tag/0.6.0
Cheers.
--
You received this message because you are
Thanks, that does look helpful, although I'll need to evaluate the
tradeoffs of not using the std lib. It's hard to believe a library could be
substantially faster than the stdlib without giving something up.
On Monday, March 5, 2018 at 9:52:04 PM UTC-8, Tamás Gulácsi wrote:
>
> You can try
I'm bummed there still isn't a good solution for this. It seems like such
an easy and extremely common thing. In a decade of webdev, I've possibly
never seen a JSON API with Golang style UpperCamelCase keys.
Is there a solution to this that I'm missing?
Here's one project I'm working on where
Clever workarounds!
These solutions don't handle the case of commenting out a function call,
which is a common need IMO. Whatever the workaround, it would still be
easier if done by vet, right?
On Wednesday, January 31, 2018 at 6:46:40 PM UTC-8, Alex Buchanan wrote:
>
> Unused var
Unused variables and imports are strictly disallowed by the Go compiler.
Most of the time, I enjoy this benefit. These days, I've started to notice
how often things go dead and/or unused in my python code.
But, sometimes, this behavior is incredibly annoying. If I'm trying to
debug something
I'm considering adding http client retries to an existing library, owned by
someone else, in order to add resiliency to errors such as http 503. I'd
like to keep the changes as minimal as possible, with maximum effect, as
usual. I'm eyeing http.Client.Transport. Possibly I could use that to
Here's some example s3 client code we use in Funnel:
https://github.com/ohsu-comp-bio/funnel/blob/master/storage/s3.go
And Amazon's S3 client docs:
https://godoc.org/github.com/aws/aws-sdk-go/service/s3#hdr-Download_Manager
Or, if you meant non-Amazon s3, we have some experience with minio:
or just what makes sense? context.TODO and
>> context.Background are two different contexts and should be treated as such.
>>
>>
>> On Friday, November 17, 2017 at 10:43:29 AM UTC-5, Alex Buchanan wrote:
>>>
>>> I don't have numbers, but context must be one of the most comm
Some ideas:
- I assume the code isn't public? If it is, you might share it
- Are you running `go test -v` for verbose logging?
- Try fmt.Printf
- Try adding printing lines at points down the stack leading up to the
point you think is failing, to make sure the code is actually running.
- Put a
I don't have numbers, but context must be one of the most commonly used
imports/types in my code. It shows up many function signatures. We try to
use it for all cancelation.
Would it make sense to add an alias "C" to the type "Context"? And maybe
"BG" for Background()?
Also, is there a
made sense. Probably too late to be writing about such things :)
On 10/24/17, 9:31 PM, "Ian Lance Taylor" <i...@golang.org> wrote:
>On Tue, Oct 24, 2017 at 8:14 PM, Alex Buchanan <buchanae.o...@gmail.com> wrote:
>>
>> Is there documentation (or
But, maybe a better solution is to faithfully record the current git (or
other VCS) details you'd need to find the code which resulted in the
binary? That way you have access to the source in its natural state.
On Thursday, October 19, 2017 at 11:49:39 AM UTC-7, Alex Buchanan wrote:
>
>
We use go-bindata to bundle text files (html, js, css, yaml) into our
binary. I bet you could use it to bundle Go source.
https://github.com/jteeuwen/go-bindata
-Alex
On Thursday, October 19, 2017 at 9:46:37 AM UTC-7, Samuel Lampa wrote:
>
> Hi Gophers,
>
> *Question:* Is there any way to
You mean fmt.Fprintf right? Formatting a string without writing to a
io.Writer (fmt.Sprintf) must be safe for concurrent use.
The "log" package should be safe for concurrent use, and has a Printf
function:
https://godoc.org/log#Logger
"""
A Logger represents an active logging object that
>
>
> Having tried using things like gleam/glow (see
> https://github.com/chrislusf/gleam) and dask (which has similar ideas but
> written in python) it sounds like a FIFO work stealing type scheduler
> wouldn't be a bad idea. In particular dask's approach is quite nicely put
> together.
explain it very well.
On Monday, October 16, 2017 at 9:42:18 AM UTC-7, Bryan Mills wrote:
>
> On Sunday, October 15, 2017 at 1:45:06 PM UTC-4, Alex Buchanan wrote:
>>
>> Show me the code! :)
>>
>> Here's mine: https://play.golang.org/p/ZwAlu5VuYr
>>
>
a look at the golang
> bindings for drmaa so you aren't left reinventing the wheel. Maybe creating
> a dumb scheduler for drmaa library might be the way to go?
>
> On Wednesday, 11 October 2017 20:14:46 UTC+1, Alex Buchanan wrote:
>>
>> Hey all,
>>
>> In Funnel
Show me the code! :)
Here's mine: https://play.golang.org/p/ZwAlu5VuYr
--
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.
I tried Go 1.9.1 today, but got strange warnings from ld. Asking here
before filing an issue as a sanity check in case my system is just borked
somehow.
ld: warning: object file
(/var/folders/kw/m6dz8snx7h33ppbkbllnqt48bkhsqx/T/go-link-991847961/00.o)
was built for newer OSX version
So many good answers! Lots of different ways to accomplish this. I'll say
that in this specific case, which is does not require every ounce of
performance, syncmap is by far the simplest and least amount of code, so
readability wins on this one.
--
You received this message because you are
Thanks for the quick help guys!
I ended up using https://godoc.org/golang.org/x/sync/syncmap
On Friday, October 13, 2017 at 11:22:44 AM UTC-7, Shawn Milochik wrote:
>
> On Fri, Oct 13, 2017 at 2:05 PM, Alex Buchanan <buchan...@gmail.com
> > wrote:
>
>> Basically, I want
Basically, I want to spawn a goroutine per object, objects have unique IDs,
and I want each routine to write its results to a shared map. Nothing will
be reading from the map while the goroutines are running.
Is this safe?
Thanks
--
You received this message because you are subscribed to the
I'm not sure I understand the example, but have you seen the grpc library's
use of options? For more type safety, you could define an interface such as
type PluginOpt interface { pluginOpt() }.
https://godoc.org/google.golang.org/grpc#CallOption
On Wednesday, October 11, 2017 at 11:23:16 AM
Hey all,
In Funnel (a distributed task toolkit) we're sort of dancing around having
a full-on scheduler. We have a scheduler that has grown from development
util, to prototype, to something we actually use, but it's missing many of
the features you'd want in production. Mostly we aim to
My weekend project for that past couple weeks has been
roger: https://github.com/buchanae/roger
This is another take on application configuration management: flags, env
vars, YAML, etc.
The core ideas are:
- define config as structs
- defaults are defined by functions which return instances of
?
Not pretty, but might work.
My best approach so far is to use time.After and panic, instead of context.
This code is being used in a test, so panic is somewhat acceptable.
Thanks again.
On 9/29/17, 1:26 PM, "Ian Lance Taylor" <i...@golang.org> wrote:
>On Fri, Sep 29, 201
package main
import (
"bytes"
"context"
"log"
"os/exec"
"time"
)
func main() {
var stdout bytes.Buffer
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
cmd := exec.CommandContext(ctx, "/bin/sh", "-c", "sleep 10; echo foo")
cmd.Stdout =
Does anyone have a strategy for accessing the docs (godoc) of vendored
dependencies?
I was a little surprised to find that godoc decided not to show vendored
packages, here:
https://github.com/golang/go/issues/13929
This also applies more generally than vendored deps. In the past, I have
30 matches
Mail list logo