[go-nuts] Re: slog formatter funcs? (e.g. slog.Infof)

2023-12-17 Thread Jonathan Amsterdam
I personally am a fan of formatted logs, but we didn't see a way to combine them with key-value pairs (you only get one variadic arg per function call). It wouldn't be hard to write a layer that wraps a slog.Logger or slog.Handler with xxxf functions. That's what I recommend. On Friday, December

[go-nuts] Re: possible bug in slog.Value json marshaling

2023-09-11 Thread Jonathan Amsterdam
Hi Steve, I'm not sure what the right answer is. Can you file this as a bug on go.dev/issues? On Thursday, September 7, 2023 at 2:30:09 PM UTC-4 Steven Pelley wrote: > Hi everyone, > > Possibly a bug or potential improvement in slog. > This will sound excessively complicated, which I recognize

[go-nuts] [ANN] type-safe templates

2023-09-10 Thread Jonathan Amsterdam
The latest version of github.com/jba/templatecheck[0] supports templates that cannot have type errors at execution time. Once you've parsed your template `t` and all associated templates, call ct, err := templatecheck.NewChecked[MyData](t) If err == nil, then ct is a CheckedTemplate[MyData].

[go-nuts] Re: wtf

2023-08-27 Thread Jonathan
Defer evaluates the arguments to the deferred func at the point of the defer statement. On Saturday, August 26, 2023 at 10:58:06 AM UTC-4 Aln Kapa wrote: > Hi All ! > Need some help, what am I doing wrong? > > https://go.dev/play/p/bBlA-i1CxNO > > // You can edit this code! > // Click here

[go-nuts] Re: slog's use of runtime.Callers() with a skip

2023-08-11 Thread Jonathan Amsterdam
The Go runtime does the right thing. On Friday, August 11, 2023 at 8:58:53 AM UTC-4 jake...@gmail.com wrote: > As far as I can tell, skip works even in the face of inlined functions, at > least when used with runtime.CallersFrames(). It would be surprising to me > if it did not. Do you have

Re: [go-nuts] What happened to sep in errorrs.join

2023-08-08 Thread 'Jonathan Amsterdam' via golang-nuts
I think you can do what you want with `HandlerOptions.ReplaceAttr`. It is given every attribute, even the message. It can't change the group names, though, and those can have newlines. On Tuesday, August 8, 2023 at 5:47:38 PM UTC-4 Ian Lance Taylor wrote: > [ + jba ] > > On Tue, Aug 8, 2023 at

Re: [go-nuts] Re: Types like http.Request and slog.LogValuer

2023-07-30 Thread 'Jonathan Amsterdam' via golang-nuts
On Saturday, July 29, 2023 at 12:18:53 PM UTC+2 Jonathan Amsterdam wrote: > >> I would write a type that wraps the request and implements LogValuer. >> Then you would log the request as >> >> logger.Debug("req", "r", requestWrapper{r}) >>

[go-nuts] Re: Using log/slog with log.Logger format?

2023-07-29 Thread 'Jonathan Amsterdam' via golang-nuts
We don't plan on exposing the commonLogger implementation, but you can write your own handler to get the exact format you want. See github.com/jba/slog/handlers for some existing code. See https://github.com/golang/example/tree/master/slog-handler-guide for a guide to writing a slog handler.

[go-nuts] Re: Types like http.Request and slog.LogValuer

2023-07-29 Thread 'Jonathan Amsterdam' via golang-nuts
I would write a type that wraps the request and implements LogValuer. Then you would log the request as logger.Debug("req", "r", requestWrapper{r}) On Thursday, July 27, 2023 at 10:01:27 AM UTC-4 Jens-Uwe Mager wrote: > I am trying to convert some older code to slog and I am running into

[go-nuts] call for data on HTTP routing

2023-06-01 Thread 'Jonathan Amsterdam' via golang-nuts
At https://github.com/golang/go/discussions/60227, we're discussing enhancements to the standard library's http.ServeMux routing. Two issues have arisen that we could use your help on. The first is easy to state: does fast routing matter? Are there Go web servers for which http.ServeMux is too

[go-nuts] golang -tour- its possible to contribute on the translation to spanish , how I can do it?

2022-10-18 Thread Jonathan L
golang -tour- its possible to contribute on the translation to spanish , how I can do it? https://go.dev/tour/welcome/2 -- 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

[go-nuts] int64(math.Inf(+1)) != math.MaxInt64

2022-10-03 Thread Jonathan Pearson
? ~Jonathan -- 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. To view this discussion on the web vi

[go-nuts] structured, leveled logging

2022-08-31 Thread 'Jonathan Amsterdam' via golang-nuts
If you're interested in logging, you may want to check out the discussion about a potential new standard library package for structured logging. https://github.com/golang/go/discussions/54763 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] Is Go a security malware risk?

2022-08-26 Thread Jonathan Reiter
of its use because it is simpler to write system (and server, in the case of C2) code. Happy to share some sources on this topic if folks are interested in a deeper dive. Best, Jonathan On Thu, Aug 25, 2022 at 1:47 AM Holloway Kean Ho wrote: > Hi, > > I be very blunt here: > >

[go-nuts] Bring back slices.BinarySearchFunc with a predicate

2022-04-04 Thread Sudhir Jonathan
The earlier method signature for slices.BinarySearchFunc was very useful: It was of the form ``` slices.BinarySearchFunc(array, func(e T) bool) ``` which returned the smallest index at which predicate would return true. This was incredibly useful to do inequality operation binary searches -

[go-nuts] Re: Alternatives to wrapping errors

2021-12-26 Thread Jonathan Hall
>> >> I'm curious what approach Dave uses now, but unless/until he writes on >> the topic, I'm also curious what other approaches people use for clean and >> cohesive error handling and reporting. >> >> If you don't wrap errors, how do you ensure meaning

[go-nuts] Alternatives to wrapping errors

2021-12-23 Thread Jonathan Hall
he writes on the topic, I'm also curious what other approaches people use for clean and cohesive error handling and reporting. If you don't wrap errors, how do you ensure meaningful error handling and reporting in your application? Thanks, Jonathan -- You received this message because

[go-nuts] Go Boring release schedule

2021-08-27 Thread Jonathan Yu
lag some period of time? I understand some folks might be on summer vacation, so wanted to check if there's an expected publication date for this so I can plan accordingly. :) Thanks, Jonathan -- You received this message because you are subscribed to the Google Groups "golang-nuts&q

[go-nuts] GopherJS 1.16 released!

2021-04-06 Thread Jonathan Hall
After lagging behind Go for about 2 years (since version 1.12), GopherJS 1.16.0+go1.16.3 has been released with Go 1.16 support! GopherJS compiles Go code to pure JavaScript code (not WebAssembly). It’s main purpose is to

Re: [go-nuts] Finding error type for `errors.As` and `errors.Is`

2021-04-05 Thread Jonathan Amsterdam
You can write such a function yourself. For that reason and since it would be rarely useful, I don't think it's likely to become part of the standard library. On Thursday, April 1, 2021 at 9:02:34 AM UTC-4 Michael Schaller wrote: > Roger, I think you slightly misunderstood me. ;-) > > It is

Re: [go-nuts] [Macos/Apple M1] HTTP client requests to ".local" domain adds 5 seconds overhead

2021-04-01 Thread Jonathan Hedrén
0:10 UTC+2 skrev Shulhan: > On Wed, 31 Mar 2021 01:47:43 -0700 (PDT) > Jonathan Hedrén wrote: > > > I've set up a development environment on my MacBook Pro M1 (running > > Big Sur 11.2.3, Go 1.16.2) with a number of small Go/.Net HTTP APIs > > that are communication with ea

[go-nuts] [Macos/Apple M1] HTTP client requests to ".local" domain adds 5 seconds overhead

2021-03-31 Thread Jonathan Hedrén
uot; and found it only in a few places, including src/net/dnsconfig_unix.go so I guess it's related to the name resolution. Anyone got an idea about what's wrong and how it can be fixed? /Jonathan -- You received this message because you are subscribed to the Google Groups "golang-nuts&qu

Re: [go-nuts] Analysis check for leaked pointers to loop variable address

2021-03-15 Thread Barisere Jonathan
a warning. I'm betting that since it's an error in most of the cases I've come across, a warning will be useful most of the time. On Monday, March 15, 2021 at 8:34:14 AM UTC+1 Jan Mercl wrote: > On Mon, Mar 15, 2021 at 3:03 AM Barisere Jonathan > wrote: > > > I think this mistak

[go-nuts] Analysis check for leaked pointers to loop variable address

2021-03-14 Thread Barisere Jonathan
Hello everyone. I have a question about a common programming error I have made several times. It regards the use of a pointer to a loop variable outside of the loop. Basically, we want to convert a slice, map, or channel of items (the source sequence) into a map, slice, or channel of pointers

Re: [go-nuts] [ANN] github.com/jba/codec, a fast encoder for Go

2021-02-15 Thread Jonathan Amsterdam
I changed the encoding so that the previous generated code is no longer necessary. Encoded data now carries all the information needed to decode struct fields correctly, even if fields have been added and reordered. On Sunday, January 24, 2021 at 8:29:58 AM UTC-5 Jonathan Amsterdam wrote

Re: [go-nuts] [ANN] github.com/jba/codec, a fast encoder for Go

2021-01-24 Thread Jonathan Amsterdam
Thanks for the suggestions. I created https://github.com/jba/codec/pull/1 to address them. You can comment in more detail there if you'd like. On Wed, Jan 20, 2021 at 12:13 PM roger peppe wrote: > On Wed, 20 Jan 2021 at 13:31, Jonathan Amsterdam > wrote: > >> The encoding sche

Re: [go-nuts] [ANN] github.com/jba/codec, a fast encoder for Go

2021-01-20 Thread Jonathan Amsterdam
erface values, > etc? is the schema implicit or sent on the wire?) > cheers, > rog. > > On Tue, 19 Jan 2021 at 14:59, Jonathan Amsterdam > wrote: > >> Uses code generation for fast encoding and decoding of Go values to >> bytes. Handles sharing and cycles too.

[go-nuts] [ANN] github.com/jba/codec, a fast encoder for Go

2021-01-19 Thread Jonathan Amsterdam
Uses code generation for fast encoding and decoding of Go values to bytes. Handles sharing and cycles too. https://pkg.go.dev/github.com/jba/codec -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

[go-nuts] [ANN] templatecheck: type-checking Go templates

2021-01-10 Thread Jonathan Amsterdam
The github.com/jba/templatecheck package[0] can validate field references and other operations of a text/template or html/template in tests or during program startup. It also works for github.com/google/safehtml/template[1]. [0] https://pkg.go.dev/github.com/jba/templatecheck [1]

[go-nuts] Is this behavior by textproto.Writer.DotWriter correct?

2020-08-23 Thread Jonathan
. If it isn't I think the documentation should note this. Jonathan -- 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.co

Re: [go-nuts] Generics and parentheses

2020-08-17 Thread Jonathan Gerber
As someone who has spent a LOT of time in Rust, I really miss generics in Go (Conversely, i miss the simplicity of Go. My personal favorite, imaginary language would probably be Go + Generics + Sum Types and destructuring) and so I am really excited to see this taking shape. That being said,

Re: [go-nuts] where is temp file created by http server

2020-07-16 Thread Jonathan Reiter
See the multipart function definition. Line 86 deals with the actual temp file writes. https://golang.org/src/mime/multipart/formdata.go?s=3015:3047#L34 Do note that under certain conditions, a multipart form might hold on closing and deleting the multipart files in temp. Debugging async code

[go-nuts] Re: decode unknown CBOR type with set of known types

2020-07-08 Thread Jonathan Amsterdam
My first question would be, is the type encoded into the CBOR blob somehow? Like by a tag? If structs are encoded as maps, with no type information, then the input doesn't have enough information to do what you want. How could the blob (using JSON notation) {"X": 1, "Y": 2} know whether

Re: [go-nuts] godoc.org pkg.go.dev banner feedback

2020-07-06 Thread 'Jonathan Amsterdam' via golang-nuts
Fixed in production. The links work now. On Monday, July 6, 2020 at 12:47:34 PM UTC-4 Julie Qiu wrote: > Thanks for letting us know! This looks like a bug - we'll look into it. I > filed an issue here: https://github.com/golang/go/issues/40071 > > > On Thursday, July 2, 2020 at 12:00:57 PM

[go-nuts] Re: go.pkg.dev missing golang packages

2020-06-27 Thread Jonathan Amsterdam
You can open an issue on the Go issue tracker. Use this link: https://golang.org/s/discovery-feedback. I filed https://golang.org/issue/39894. On Saturday, June 27, 2020 at 1:20:15 PM UTC-4, Steve Roth wrote: > > I understand that some Go package documentation is not documented on > go.pkg.dev

Re: [go-nuts] Using context package for goroutines cancellation is quite verbose

2020-06-10 Thread Jonathan Amsterdam
Typically, a network communication system, like gRPC for example, will accept contexts for network calls and turn context done-ness into an error. The typical signature of an RPC-backed function is func(context.Context, req *Request) (*Response, error) If the context times out or is

Re: [go-nuts] McAfee and the module cache on WSL: rename : permission denied

2020-03-12 Thread Jonathan Reiter
I don't think McAfee ENS officially supports WSL. At least that was the case in 2018 when I last tried. This would probably be evident in its labelling WSL /tmp writes as the beginnings of an attack - you could always check your scan logs (at %ProgramData%\McAfee\Endpoint Security\Logs) to see

Re: [go-nuts] RFC for opt-in streaming support in encoding/json package

2019-08-10 Thread Jonathan Hall
You're absolutely right. I just meant that the tokenizer interface wouldn't be completely replaced. There are still some corner cases where it will be necessary. On Friday, August 9, 2019 at 11:41:17 PM UTC+2, burak serdar wrote: > > On Fri, Aug 9, 2019 at 3:32 PM Jonathan Hall &

Re: [go-nuts] RFC for opt-in streaming support in encoding/json package

2019-08-09 Thread Jonathan Hall
ffered output > option that directly writes to the io.Writer. > > I like the idea of stream-friendly marshaler/unmarshaler interfaces. > > > > > -Original Message- > > From: Jonathan Hall > > Sent: Aug 9, 2019 11:00 AM > > To: golang-nuts &

Re: [go-nuts] RFC for opt-in streaming support in encoding/json package

2019-08-09 Thread Jonathan Hall
Oh, thanks for pointing that out. it is indeed very similar to my proposal. What do you think the chances of getting it resurrected and merged? Is more discussion still needed with respect to sync.Pool? On Friday, August 9, 2019 at 6:15:31 PM UTC+2, Ian Davis wrote: > > You may also be

Re: [go-nuts] RFC for opt-in streaming support in encoding/json package

2019-08-09 Thread Jonathan Hall
ems rather rare (or > very difficult to do well). > > -Original Message- > From: Jonathan Hall > Sent: Aug 9, 2019 11:00 AM > To: golang-nuts > Subject: Re: [go-nuts] RFC for opt-in streaming support in encoding/json > package > > An interesting observati

Re: [go-nuts] RFC for opt-in streaming support in encoding/json package

2019-08-09 Thread Jonathan Hall
f the APIs would end up looking very much the same, anyway. Jonathan On Friday, August 9, 2019 at 5:53:41 PM UTC+2, Robert Engels wrote: > > In other environments (e.g. Java), the streaming processors are distinct > from the instance oriented - usually for good reason as the APIs ar

Re: [go-nuts] RFC for opt-in streaming support in encoding/json package

2019-08-09 Thread Jonathan Hall
Thanks for the reply. My responses inline below. On Friday, August 9, 2019 at 5:14:52 PM UTC+2, burak serdar wrote: > > On Fri, Aug 9, 2019 at 8:53 AM Jonathan Hall > wrote: > > > > Can you say more? Better in which way? > > Better in the way that it wo

Re: [go-nuts] RFC for opt-in streaming support in encoding/json package

2019-08-09 Thread Jonathan Hall
Can you say more? Better in which way? On Friday, August 9, 2019 at 4:46:19 PM UTC+2, burak serdar wrote: > > > Instead of modifying the existing Encoder/Decoder, wouldn't it be > better to do this as a separate encoder/decoder? > > > > > > > > > > -- > > You received this message because

[go-nuts] RFC for opt-in streaming support in encoding/json package

2019-08-09 Thread Jonathan Hall
*I debated posting here, or straight to GitHub. If that's the better place, I can move the thread there. * I have long wanted proper streaming support in the `encoding/json` library. Lately I’ve been doing some digging to understand the current state of things, and I think I’ve come to grips

Re: [go-nuts] A simplified generics constraint system.

2018-09-16 Thread Jonathan Amsterdam
On Friday, September 14, 2018 at 8:06:31 PM UTC-4, alanfo wrote: > > Thanks for your comments, Jonathan. > > I did in fact deal with all the cases you mention in my 'fuller' proposal: > > https://gist.github.com/alanfo/5da5932c7b60fd130a928ebbace1f251 > > where I'd u

Re: [go-nuts] A simplified generics constraint system.

2018-09-14 Thread Jonathan Amsterdam
I'm sympathetic to the general idea, but I don't think this quite does it. In addition to introducing a bunch of new names, it's not expressive enough: - You can't express "string or []byte", as you note. There are many algorithms where this would be useful. See the strings and bytes packages

[go-nuts] Re: Go 2 error-handling counter-proposal: returnfrom

2018-09-13 Thread Jonathan Amsterdam
What's the meaning of this code? func main() { f := g() f() } func g() func() { Top: return func() { returnfrom Top, nil} } On Thursday, September 13, 2018 at 3:29:03 PM UTC-4, Scott Pakin wrote: > > I recently added to the Go 2 Error Handling Feedback >

Re: [go-nuts] Scrapping contracts (was: "Generics as bultin typeclasses")

2018-09-12 Thread Jonathan Amsterdam
Not to be snide, but we are looking for examples, not kinds of examples. Do you know of actual code where this would benefit? For example, could field accessors improve the standard image and image/color packages? On Wednesday, September 12, 2018 at 9:15:24 AM UTC-4, Mandolyte wrote: > > On

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-11 Thread Jonathan Amsterdam
On Tuesday, September 11, 2018 at 9:24:56 AM UTC-4, Larry Clapp wrote: > > This question frankly struck me odd, given the context. To paraphrase: > "Do I have examples of where accessing a field in a generic struct type > might be useful?" I kind of assumed that, hip-deep as we are in a >

[go-nuts] Re: Scrapping contracts (was: "Generics as bultin typeclasses")

2018-09-11 Thread Jonathan Amsterdam
> > * I think constraining type-parameters to channel/slice/map types might > not be needed at all. Instead of, say "func Foo(type T channelOfBar) (ch > T)", ISTM that we can use "func Foo(ch chan Bar)". Since any channel-type > with element type Bar can be assigned to `chan Bar`, this would

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-11 Thread Jonathan Amsterdam
the contract design doc, but I have not put enough thought > into it that there might not be a couple nooks and crannies I haven't > thought of, as you've proven before :) ) > > On Tue, Sep 11, 2018 at 1:21 AM Jonathan Amsterdam > wrote: > >> >> >> On Mon

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-11 Thread Jonathan Amsterdam
the needed contracts as combinations of this handful of >> base-cases, why would we need to allow the full power of Go syntax, which >> enables to write all the less than obvious ones too? >> >> (to re-emphasize: All of this isn't polished. I did sanity-check against

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-10 Thread Jonathan Amsterdam
On Monday, September 10, 2018 at 4:17:57 PM UTC-4, Axel Wagner wrote: > > On Mon, Sep 10, 2018 at 8:57 PM Jonathan Amsterdam > wrote: > >> FWIW, I think Ian's criticism of not wanting a list of new identifiers to >>> express operator constraints is fair. It

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-10 Thread Jonathan Amsterdam
I'm wrong about `==` here, because it's defined for interface values. `comparable` could be an interface. But it won't work for other operators like `<` or `+`. On Sunday, September 9, 2018 at 2:49:26 PM UTC-4, Jonathan Amsterdam wrote: > > FWIW, in my pseudo-interface description

[go-nuts] Re: Link: Getting specific about generics

2018-09-10 Thread Jonathan Amsterdam
Sorry, I'm wrong about `eq`. It could be an interface, because `==` is treated specially for interface types. But you couldn't have an interface for any other operator, like `<` or `+`. On Monday, September 10, 2018 at 9:55:04 AM UTC-4, Jonathan Amsterdam wrote: > > From the

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-10 Thread Jonathan Amsterdam
ce way to have a >>> discussion. >>> >>> But yes, if it makes you happier, we can call them "contracts", allow to >>> embed them into interfaces and remove contract declarations from the design >>> (or, allow embedding interfaces in

[go-nuts] Re: Link: Getting specific about generics

2018-09-10 Thread Jonathan Amsterdam
> > > The problem is that the spec says that the operands of == have to be the > same type > Correction: one operand must be assignable to the type of the other. The example still stands: you can't compare an int and a float64. -- You received this message because you are subscribed to the

[go-nuts] Re: Link: Getting specific about generics

2018-09-10 Thread Jonathan Amsterdam
>From the blog post: For example there could be an eq interface that’s equivalent to a contract > with an x == x. Actually, there can't. If eq were an interface, then func f(x, y eq) bool { return x == y } would be legal. And so would the call var a int var b float64

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-10 Thread Jonathan Amsterdam
On Sunday, September 9, 2018 at 3:52:24 AM UTC-4, Ian Lance Taylor wrote: > > On Sat, Sep 8, 2018 at 7:53 PM, Jonathan Amsterdam > > wrote: > >> When is it important to not just express what operations are > >> required for a type, but also to try to rule ou

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-10 Thread Jonathan Amsterdam
> base-contracts you can use for operators) and you'd end up with pretty much > my design. > > On Sun, Sep 9, 2018 at 11:17 PM Jonathan Amsterdam > wrote: > >> >> >> On Sunday, September 9, 2018 at 3:19:16 PM UTC-4, Axel Wagner wrote: >>>

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-09 Thread Jonathan Amsterdam
On Sunday, September 9, 2018 at 3:19:16 PM UTC-4, Axel Wagner wrote: > > On Sun, Sep 9, 2018 at 8:49 PM Jonathan Amsterdam > wrote: > >> The problem is that this program seems to type-check, but it is invalid. >> The == operator is specified to work on o

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-09 Thread Jonathan Amsterdam
raph(Node, Edge)) (g G, from, to Node) []Edge except according to your description, all three type parameters would have Graph(Node, Edge) as constraints, which doesn't make sense either. > On Sun, Sep 9, 2018 at 8:21 PM Jonathan Amsterdam > wrote: > >> >>> F

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-09 Thread Jonathan Amsterdam
On Saturday, September 8, 2018 at 11:58:46 PM UTC-4, Robert Engels wrote: > > For the math operator, since Go already doesn’t do automatic numeric > conversions, all of the operators are almost trivially implemented as > methods, e.g. operator + is > > pseudo generic interface - not really

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-09 Thread Jonathan Amsterdam
> > FWIW, in my pseudo-interface description > ... > You mention that comparable is a pseudo-interface, which means the type supports the == and != operators. You say that comparable and the other pseudo-interfaces are types. So

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-09 Thread Jonathan Amsterdam
> > > FWIW, in my pseudo-interface description > , > Unrelated to this particular issue, but since you link to your blog post, I just want to mention that in your graph example, func ShortestPath(type Node, Edge) (g Graph(Node,

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-08 Thread Jonathan Amsterdam
I don't think Go will add operator overloading, even if it simplifies generics. Go has a core principle that doesn't get written down very much: syntax is hard-coded. If you see a piece of syntax in Go, it will never execute user code. (The obvious exception, of course, is a function call.)

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-08 Thread Jonathan Amsterdam
> > When is it important to not just express what operations are > required for a type, but also to try to rule out some types? > I think the short answer is: numeric code. That's when one thinks about which types make sense for an algorithm, not just which operations. I'm not exactly sure

[go-nuts] confused about assignability

2018-09-06 Thread Jonathan Amsterdam
Consider type Int int var y int = Int(3) The spec says A value x is assignable to a variable of type T ("x is assignable to T") if one of the following conditions applies: - x's type V and T have identical underlying types

Re: [go-nuts] Re: Is it possible to unmarshall Json by selecting the struct from a field in the Json?

2018-03-28 Thread Jonathan Yu
oded['class']::jsonDeserialize($decoded); >>> >>> >>> assert($obj->label == "Lorem"); >>> >>> So the above really translates to calling the static method on a >>> concrete class, like this: >>> >>> $obj = Domain\\Model\\Me

Re: [go-nuts] Go Programming Language Course

2018-02-21 Thread Jonathan Yu
s 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: Proposal: return if any not nil

2018-02-16 Thread Jonathan
ut I'm happy with Go as it is. Jonathan -- 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, vis

Re: [go-nuts] can someone create an example for me of a webpage that can run a bash command ?

2018-02-14 Thread Jonathan Yu
/articles/wiki/ It's not specifically what you were asking, but this might be something that could be done without Go at all, by emulating a full Linux system entirely in the browser. For example: https://bellard.org/jslinux/ Cheers, Jonathan On Wed, Feb 14, 2018 at 6:56 PM, David Brendlinger

Re: [go-nuts] Selenium webdriver based testing in Go

2017-12-31 Thread Jonathan Yu
I've had a lot of success with agouti, though I don't know enough about Selenium to be sure that it's what you're asking for. I used it to do browser testing of a rich internet application, with chrome driver. On Dec 31, 2017 14:56, "Tong Sun" wrote: > Hi, > > Anyone here

[go-nuts] methods for error

2017-12-24 Thread Jonathan Amsterdam
Inspired by Rob Pike's recent blog post and Dave Cheney's errors package , I wrote down some methods that I think all errors should implement. The key idea is that an error only needs to

Re: [go-nuts] how to do numpy.fromstring in Go ?

2017-12-06 Thread Jonathan Yu
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. > -- Jonathan Yu / *@jawnsy* on LinkedIn &l

[go-nuts] Re: ssh session

2017-12-04 Thread Jonathan Pittman
Elaborate on what you mean by "another place." Do you just need multiple sessions within your own program or do you need to pass that connection to another program (e.g. a proxy command or shared socket connection)? Within your program, once you have dialed an ssh connection and have an

[go-nuts] Re: Dangers of package renaming

2017-12-03 Thread Jonathan Hall
ry are using a vendoring tool with semver support, but this is an assumption I'm willing to live with. Any drawbacks I'm not seeing with this approach? -- Jonathan On Saturday, December 2, 2017 at 4:33:06 PM UTC+1, Jonathan Hall wrote: > > I maintain an open-source Go package with a few doz

[go-nuts] Dangers of package renaming

2017-12-02 Thread Jonathan Hall
that the package has sub-packages as a dependencies (i.e. github.com/flimzy/kivik dependson github.com/flimzy/kivik/errors), in case this complicates things. Thank you, Jonathan -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubs

Re: [go-nuts] Re: invitation to gophers.slack.com

2017-11-17 Thread Jonathan Yu
se 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. > -- Jonathan Yu

Re: [go-nuts] Golang performance benchmarks on arm64 (Qualcomm Centriq 2400)

2017-11-10 Thread Jonathan Yu
r ARM at present, but certainly Centriq is fascinating) despite being opened up (OpenPOWER). I'm not close enough to either of these communities to speculate as to why this is so. -- Jonathan Yu / *@jawnsy* on LinkedIn <https://linkedin.com/in/jawnsy>, Twitter <https://twitter.com/jawnsy>,

Re: [go-nuts] http server request queue

2017-10-30 Thread Jonathan Yu
> For more options, visit https://groups.google.com/d/optout. > -- Jonathan Yu / *@jawnsy* on LinkedIn <https://linkedin.com/in/jawnsy>, Twitter <https://twitter.com/jawnsy>, GitHub <https://github.com/jawnsy>, Facebook <https://facebook.com/jawnsy> *“Ever tried. E

Re: [go-nuts] Handle sub domains in go.

2017-10-27 Thread Jonathan Yu
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, visi

Re: [go-nuts] Re: How to read multi-page TIFF image?

2017-09-25 Thread Jonathan Pittman
ild something that would watch for newly added RAW images and create jpeg > thumbnails, and various sizes for sharing via blog, twitter, whatever. > > On Monday, September 25, 2017 at 3:40:25 PM UTC+2, Jonathan Pittman wrote: >> >> Wether a multi-page TIFF uses multiple

Re: [go-nuts] Re: How to read multi-page TIFF image?

2017-09-25 Thread Jonathan Pittman
Wether a multi-page TIFF uses multiple IFDs or uses one IFD with multiple SubIFDs is implementation dependent. Though, I think most probably just use multiple IFDs. The basic structure of an IFD and a SubIFD is essentially the same. The main difference is where you find their offsets and

[go-nuts] Possible bug in golang type checker

2017-09-12 Thread jonathan . hurter
i) Is that a bug in the golang type checker or am i missing something. Thanks, Jonathan Hurter -- 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 g

[go-nuts] Re: How to break a long code into lines in Golang?

2017-07-26 Thread Jonathan
, Int64Flag_xxIntervalMS ) I've done this even when the code is only used once. Sometimes it makes the code clearer by making the overall structure clearer. Jonathan -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

Re: [go-nuts] Re: Who wants to use Go to process your camera's raw files?

2017-07-05 Thread Jonathan Pittman
server with Go. > > > On Tuesday, July 26, 2016 at 9:36:31 PM UTC-5, Jonathan Pittman wrote: >> >> Well me too! I am looking to see what level of interest there is in the >> Go community to see this happen. I am also looking for people who are >> interested in working on thi

[go-nuts] minimum b.N

2017-05-23 Thread jonathan . gaillard
I don't think there is a way, but is there a way to specify a minimum b.N? So we have a bunch of benchmarks, but some are benchmarking things that take milliseconds and some seconds. So specifying benchtime like 30s makes the whole build run too slow. -- You received this message because you

Re: [go-nuts] New fully featured bash completion for go - written in go

2017-05-13 Thread Jonathan Yu
ute and star! > > -- > 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, vi

Re: [go-nuts] How to get size of http request/stream size transferred over wire?

2017-05-13 Thread Jonathan Yu
" 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. > -- Jonathan Yu / *@jawnsy* on LinkedIn <https://linkedin.com/in

[go-nuts] using GitHub Pages for import paths

2017-05-08 Thread 'Jonathan Amsterdam' via golang-nuts
What do you all think about using GitHub Pages URLs for import paths? I got to thinking about that because Go is moving towards having real dependency management, and it looks like the repo is going to be the unit of versioning. That implies that repo boundaries are going to be changing a lot in

[go-nuts] Re: ...interface{} vs interface{} + reflection

2017-05-03 Thread Jonathan Hall
Nice find wrt: mgo. That is a good analogy. And thanks for your input. That is a good observation that it could also save some internal conversion. -- Jonathan On Tuesday, May 2, 2017 at 8:12:39 PM UTC+2, Jonathan Hall wrote: > > I have a public API that takes `...interface{}` as an ar

[go-nuts] ...interface{} vs interface{} + reflection

2017-05-02 Thread Jonathan Hall
for the conversion is presumably slower than doing the conversion in the caller. Are there other pros or cons I'm not considering that I should take into account when deciding how to proceed? Much thanks, -- Jonathan -- You received this message because you are subscribed to the Google Groups

[go-nuts] Re: Best practice for client API with both context-aware and non-context-aware methods

2017-04-17 Thread Jonathan Hall
Thank you, everyone, for the feedback. You've validated my thoughts on the matter. I just removed all of the non-Context methods from my library, and am much happier with it already. Cheers. On Saturday, April 15, 2017 at 2:49:55 AM UTC+2, Jonathan Hall wrote: > > I'm working on a

[go-nuts] Best practice for client API with both context-aware and non-context-aware methods

2017-04-14 Thread Jonathan Hall
at. Are there other alternatives I should consider? Much thanks, Jonathan -- 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...@goog

Re: [go-nuts] gomock - why do recorder methods use interface{}?

2017-04-06 Thread Jonathan Yu
t; On 05/04/2017 18:06, Jonathan Yu wrote: > >> Hi everyone, >> >> I've been using gomock to generate mock objects (in source mode), and it's >> been pretty great - way better than maintaining similar code on my own. >> One >> thing that I find curious, th

[go-nuts] gomock - why do recorder methods use interface{}?

2017-04-05 Thread Jonathan Yu
ed with a string parameter, right? Jonathan -- Jonathan Yu / *@jawnsy* on LinkedIn <https://linkedin.com/in/jawnsy>, Twitter <https://twitter.com/jawnsy>, GitHub <https://github.com/jawnsy>, Facebook <https://facebook.com/jawnsy> *“Ever tried. Ever failed. No matter. Try

[go-nuts] 1.8.1 release time frame

2017-03-07 Thread jonathan . gaillard
Anyone know if there is a plan for the 1.8.1 in terms of time? It seems to have issues building up on 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

Re: [go-nuts] reading/writing after http.Handler returns

2017-03-03 Thread jonathan . gaillard
Yes and I'll wait for that change, thanks! On Friday, March 3, 2017 at 2:01:25 PM UTC-8, bradfitz wrote: > > I'm not sure I understand what the bug report here is. > > Is this https://github.com/golang/go/issues/16100 ? > > > On Thu, Mar 2, 2017 at 3:06 PM, <jonathan

  1   2   >