So, for what it's worth:
https://karthikkaranth.me/blog/functions-implementing-interfaces-in-go/
Otherwise, yeah. I'd love to be able to define interfaces with extra
methods for implementors, but if you arrange your code around "traits",
microstructs intended to present a possibly unergonomic
Uh, you should check the code:
github.com/jackc/pgtype/blob/master/float8.go If you know what you have and
what you're dealing with, and if you actually check the error result, you
do get safety. If you don't know what you've got, or if you're iterating
through the values, then you end up hitti
Sorry, the predicate should be
var b T
pred := func(a T) bool { return cmp(a, b) >= 0 }
On Tue, Apr 5, 2022 at 7:27 AM Axel Wagner
wrote:
> Hm I must say, I also don't really understand removing the predicate-based
> one. It is easy, when you have a comparison function, to get to a predicate:
>
Hm I must say, I also don't really understand removing the predicate-based
one. It is easy, when you have a comparison function, to get to a predicate:
pred := func(a, b T) bool { return cmp(a, b) >= 0 }
But not the other way around, so a predicate is more general.
I used the predicate version of
On Mon, Apr 4, 2022 at 5:16 PM arthurwil...@gmail.com
wrote:
>
>
>
> On Monday, April 4, 2022 at 7:00:49 PM UTC-5 arthurwil...@gmail.com wrote:
>>
>> On Monday, April 4, 2022 at 6:14:30 PM UTC-5 Ian Lance Taylor wrote:
>>>
>>> On Mon, Apr 4, 2022 at 3:49 PM arthurwil...@gmail.com
>>> wrote:
>>> >
On Monday, April 4, 2022 at 7:00:49 PM UTC-5 arthurwil...@gmail.com wrote:
> On Monday, April 4, 2022 at 6:14:30 PM UTC-5 Ian Lance Taylor wrote:
>
>> On Mon, Apr 4, 2022 at 3:49 PM arthurwil...@gmail.com
>> wrote:
>> >
>> >
>> >
>> > On Sunday, April 3, 2022 at 10:35:04 PM UTC-5 Ian Lance
On Monday, April 4, 2022 at 6:14:30 PM UTC-5 Ian Lance Taylor wrote:
> On Mon, Apr 4, 2022 at 3:49 PM arthurwil...@gmail.com
> wrote:
> >
> >
> >
> > On Sunday, April 3, 2022 at 10:35:04 PM UTC-5 Ian Lance Taylor wrote:
> >>
> >> On Sun, Apr 3, 2022 at 6:21 PM arthurwil...@gmail.com
> >
On Mon, Apr 4, 2022 at 3:49 PM arthurwil...@gmail.com
wrote:
>
>
>
> On Sunday, April 3, 2022 at 10:35:04 PM UTC-5 Ian Lance Taylor wrote:
>>
>> On Sun, Apr 3, 2022 at 6:21 PM arthurwil...@gmail.com
>> wrote:
>> >
>> > I'm trying to build an unoptimized version of the standard library for
>> > d
I think that playground is broken.
*./prog.go:22:9: undefined: translatableImpl./prog.go:27:11: undefined:
translatableImplGo build failed.*
I fixed it like this:
https://go.dev/play/p/vZlwZIe9Ras
On Monday, April 4, 2022 at 1:27:46 PM UTC-4 Ron Green wrote:
> in case anyone get's here
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 -
l
On Sunday, April 3, 2022 at 10:35:04 PM UTC-5 Ian Lance Taylor wrote:
> On Sun, Apr 3, 2022 at 6:21 PM arthurwil...@gmail.com
> wrote:
> >
> > I'm trying to build an unoptimized version of the standard library for
> debugging.
>
> You can just use
>
> go build -gcflags=all="-N -l"
>
>
Th
Thanks all for the hint and the snippets. I am all set now.
On Tuesday, 5 April 2022 at 00:13:46 UTC+10 tay...@fastmail.com wrote:
> Take a look at time.ParseDuration and its example:
> https://pkg.go.dev/time#ParseDuration
>
> On Sun, Apr 3, 2022, at 3:48 PM, vika...@gmail.com wrote:
>
> I am l
I was really annoyed that, apparently, I accidentally deleted the message
you're replying to, immediately after writing it.
I agree with you about being possibly surprised by values of outside of an
expected range. The benefit of the above is merely that accessing it is
guaranteed to be checked
in case anyone get's here and is confused...
you can wrap the additional functionality in the struct and use the
interfaces from before
https://go.dev/play/p/e8aS0PZC6Zh
On Monday, February 2, 2015 at 2:55:30 PM UTC+2 oju...@gmail.com wrote:
> The code start to get smart when you combine inter
Hello gophers,
We plan to issue Go 1.18.1 and Go 1.17.9 on Thursday, April 7th.
These minor releases include a PRIVATE security fix to the standard library.
Following our security policy, this is the pre-announcement of those
releases.
Thanks,
Julie on behalf of the Go team
--
You received th
Take a look at time.ParseDuration and its example:
https://pkg.go.dev/time#ParseDuration
On Sun, Apr 3, 2022, at 3:48 PM, vika...@gmail.com wrote:
> I am looking to convert a *string* (say 4) to type *time.Duration*.
>
> I've looked around but could not find a way to do so.
>
> // https://go.de
*Another use case for automatically translating codewritten in Java to
Golang is Exception Handling.The next example is likely to be about
multithreading.Example in Java:*
package com.builder.start.here;
public class CatchException {
public static void main(String[] args) {
try
17 matches
Mail list logo