I used the new feature netip of Go1.18 to write code that applies both ipv4
and ipv6
https://go.dev/play/p/Ynx1liLAGs2
在2015年3月22日星期日 UTC+8 12:48:25 写道:
> On Wednesday, March 18, 2015 at 7:33:54 AM UTC+1, Bakul Shah wrote:
>>
>> Rewriting this in Go is not difficult but you have to add some
Should be fixed by https://go-review.googlesource.com/c/go/+/448899
On Tuesday, November 8, 2022 at 4:34:00 PM UTC-8 Keith Randall wrote:
> (Although normally lfstack nodes should not be heap allocated in the first
> place?)
>
>
> On Tuesday, November 8, 2022 at 4:32:11 PM UTC-8 Keith Randall w
(Although normally lfstack nodes should not be heap allocated in the first
place?)
On Tuesday, November 8, 2022 at 4:32:11 PM UTC-8 Keith Randall wrote:
> I don't think checkptr is intended to be applied blindly inside the
> runtime. The lfstack code is definitely doing things that checkptr wa
I don't think checkptr is intended to be applied blindly inside the
runtime. The lfstack code is definitely doing things that checkptr was
designed to catch and flag.
Maybe the lfstack routines need a go:nocheckptr annotation?
On Tuesday, November 8, 2022 at 11:21:30 AM UTC-8 David Pacheco wrote
On Tue, 2022-11-08 at 09:17 -0800, TheDiveO wrote:
> I've always wondered how to deal with exported versus unexported
> identifiers in scripts like Chinese?
There is an issue for this https://go.dev/issue/22188 which discusses
the approaches that are currently used with a view to making it easier.
I've always wondered how to deal with exported versus unexported
identifiers in scripts like Chinese?
On Sunday, November 6, 2022 at 3:08:59 PM UTC+1 ba...@iitbombay.org wrote:
> In Indic scripts in certain contexts you have to use a vowel sign for the
> typography to make sense; you can’t use
On Tue, Nov 8, 2022 at 7:55 AM Aviram Hassan wrote:
>
> I see that some runtime functions have both `abi0` interface and
> `ABIInternal`.
> I was wondering what makes the compiler do so, and if I can make it do the
> same for my defined functions?
> A bit of a background - I'm doing a bit of a l
On Tue, Nov 8, 2022 at 7:55 AM Xie Yuchen wrote:
>
> I checked with the issue about how to refer no-copy and the check of cmd/vet.
> After checking, I'm curious that why not define mutex as an interface, as
> interface always copy like a reference, which means users don't worry to copy
> by val
>From my limited experience, I notice two things:
1. I've rarely ever seen the need arise in my limited own experience to
copy objects that would like to share their mutex. I would rather consider
this to be most of the time a design issue, but I will be happy to stand
corrected. Th
Hi, Giorgi and nice to meet you.
I am interested in this position so enclosed my resume for your reference.
Just let me know if you need any additional information.
Best Regards,
Yamil
El mar, 8 nov 2022 a las 10:54, Giorgi Dalakishvili
() escribió:
> Hello Go Devs, I am Giorgi Tech recruiter a
I checked with the issue about how to refer no-copy and the check of
cmd/vet. After checking, I'm curious that why not define mutex as an
interface, as interface always copy like a reference, which means users
don't worry to copy by value and cause an error.
Design by the interface can always c
Hi,
I see that some runtime functions have both `abi0` interface and
`ABIInternal`.
I was wondering what makes the compiler do so, and if I can make it do the
same for my defined functions?
A bit of a background - I'm doing a bit of a lowlevel fun, and I want to
hook Go functions using just Go c
Hello Go Devs, I am Giorgi Tech recruiter at Picnic, Palo Alto / Ca based
fast-growing app with 2 million users already.
I want you to offer Golang Dev job, you can work remotely.
If you have three years of experience in the Go language I want to offer
you a really good working environment, a com
Thanks for your help and very interesting ideas. In the end I used this:
type Set[T comparable] map[T]struct{}
func New[T comparable](elements ...T) Set[T] {
set := make(Set[T], len(elements))
for _, element := range elements {
set[element] = struct{}{}
}
return set
}
fun
To answer the rest of the question, since they are premptable they can be
resumed on any thread. Go tries to use the same thread for performance but will
issue memory barriers when it cannot.
> On Nov 8, 2022, at 5:17 AM, peterGo wrote:
>
>
> piotr,
>
> Goroutines are now asynchronously pr
If you're sure that T is an int or a string, then why not constrain it as
such? https://go.dev/play/p/1kT6EacMHco
You could go further and constrain it to allow any type with ordering
defined: https://go.dev/play/p/il5koj1RPkh
If you want to allow any kind of comparable key in your set, one could
piotr,
Goroutines are now asynchronously preemptible. As a result, loops without
function calls no longer potentially deadlock the scheduler or
significantly delay garbage collection. February 2020,
https://go.dev/doc/go1.14#runtime
peter
On Tuesday, November 8, 2022 at 3:31:25 AM UTC-5 pio
On Tue, Nov 8, 2022 at 10:56 AM 'Mark' via golang-nuts
wrote:
> // Want to sort by T < T //
> elements := make([]string, 0, len(me))
> for element := range me {
> elements = append(elements, fmt.Sprintf("%#v", element))
> }
> sort.Strings(elements)
>
I see that your example works, but I can't see how to adapt it to my use
case.
type Set[T comparable] map[T]struct{}
func New[T comparable](elements ...T) Set[T] {
set := make(Set[T], len(elements))
for _, element := range elements {
set[element] = struct{}{}
}
return set
On Tue, Nov 8, 2022 at 9:53 AM 'Mark' via golang-nuts
wrote:
> Given a function:
>
> func F[T comparable](a T) {
> }
>
> is it possible to check T's type inside F?
>
> My use case is that I have a function with signature G[T comparable](x []T)
> and inside G I want to sort the elements in slice
Given a function:
func F[T comparable](a T) {
}
is it possible to check T's type inside F?
My use case is that I have a function with signature G[T comparable](x []T)
and inside G I want to sort the elements in slice x where T could be int or
string.
This arises in a tiny generic set module I
I am fine with affinity changes during, say, a mutex or channel operation.
But does (or merely can) Go preempt the execution of leaf assembly
functions, basically re-creating threads in user space? Or is the currently
assigned thread mapping locked until the function decides to return, as
coope
I mean the Plan 9 assembler. Also assume the function is a leaf function,
just a long one. Can such a function be preempted by Go runtime and
re-assigned to another thread or can the reassignment happen only
cooperatively, in a number of roughly predictable selected places?
poniedziałek, 7 lis
23 matches
Mail list logo