Sorry, I temporarily switch to Go 1.3.
The result is constantly 0 0 1 for Go 1.15 when N > 2.
On Saturday, August 15, 2020 at 12:30:32 AM UTC-4, T L wrote:
>
>
> package main
>
> import "fmt"
> import "bytes"
> import "testing"
>
> const N = 0
> var name = bytes.Repeat([]byte{'x'}, N)
> var m = ma
https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md#pointer-method-example
has this example:
// Setter2 is a type constraint that requires that the type
// implement a Set method that sets the value from a string,
// and also requires that the type be a poin
package main
import "fmt"
import "bytes"
import "testing"
const N = 0
var name = bytes.Repeat([]byte{'x'}, N)
var m = make(map[string]string, 10)
var s string
func f() {
s = m[string(name)]
}
func g() {
key := string(name)
s = m[key]
}
func h() {
m[string(name)] = "Golang"
}
On Thu, Aug 13, 2020 at 11:25 PM Patrick Smith wrote:
> I tried out a few different implementations, evaluating the polynomial
> instead of finding roots,
> at https://go2goplay.golang.org/p/g8bPHdg5iMd . As far as I can tell,
> there is no sensible way to
> do it with an interface that is impleme
How to force update the latest version of package in pkg.go.dev?
My https://github.com/go-easygen/easygen/releases/tag/v5.1.01 has been
release for over 10 days, but the
https://pkg.go.dev/github.com/go-easygen/easygen?tab=versions is still
showing an old version.
>From https://proxy.golang.o
* Volker Dobler [200814 14:53]:
> On Friday, 14 August 2020 20:39:37 UTC+2, K Richard Pixley wrote:
> > Isn't this the default location? I just untarred the distribution...
>
> No. There is a reason https://golang.org/doc/install#install
> states to do tar -C /usr/local -xzf go$VERSION.$OS-$AR
> Thanks for the example.
My pleasure :D Thank you for taking a look!
> Nice example! Presumably if you wanted to do actual Porter-Duff though,
you'd want some arithmetic rather than just comparison.
Thank you! And yeah if you wanted to do something like a color-dodge or
other blend modes you'
I have several basic questions. I examined a couple of golang programs,
and got really confused.
I started by looking at a kube-proxy from Kubernetes release 1.15 (probably
either 1.15.9 or 1.15.12) on Linux 4.15.0 using `/proc/[pid]/statm`.
As a reminder, here is what man procfs has to say a
Nice example! Presumably if you wanted to do actual Porter-Duff though,
you'd want some arithmetic rather than just comparison.
One observation: you don't actually need the "comparable" constraint on
many of the core entities there (e.g. Rect and Op) because they don't
actually use any compare ope
On Thu, Aug 13, 2020 at 8:37 PM Beka Westberg wrote:
>
> Hello! I just ran into a problem that is solved really nicely with the new
> generics proposal and I thought someone might find it interesting :D
>
> I was trying to implement a library for doing ascii art programmatically. The
> main stru
On Fri, Aug 14, 2020 at 8:29 AM wrote:
>
> i'm trying to create an object file by using "go build" for GOOS=linux
> GOARCH=386.
> My current go environment has GOOS=linux GOARCH=amd64.
>
> i know that go build directly builds and links the files, but i want to link
> files using an external link
On 8/14/20 11:54, 'Carla Pfaff' via golang-nuts wrote:
People and installers usually install Go in /usr/local/go on Unix-like
systems.
~/go is the default GOPATH if not set, so ~/go/bin is where binaries
installed via "go get" / "go install" land. But the Go distribution
itself must not be un
On Fri, Aug 14, 2020 at 8:52 PM Joe Marty
wrote:
>
>> If I know that a value exists, or am fine using the zero value (again,
>> that's the majority of my personal use-cases for maps at least), having to
>> use a statement just to discard the extra bool is annoying.
>>
>
> Right, so this brings me
People and installers usually install Go in /usr/local/go on Unix-like
systems.
~/go is the default GOPATH if not set, so ~/go/bin is where binaries
installed via "go get" / "go install" land. But the Go distribution itself
must not be under GOPATH.
--
You received this message because you ar
On Friday, 14 August 2020 20:39:37 UTC+2, K Richard Pixley wrote:
>
> Isn't this the default location? I just untarred the distribution...
>
No. There is a reason https://golang.org/doc/install#install
states to do tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz
V.
--
You received this me
>
>
> If I know that a value exists, or am fine using the zero value (again,
> that's the majority of my personal use-cases for maps at least), having to
> use a statement just to discard the extra bool is annoying.
>
Right, so this brings me back to a nice solution to both our use cases,
wh
Never mind, I just noticed the original post answered it. Sorry, read it
too quickly.
On Thursday, August 13, 2020 at 3:13:51 PM UTC-4 Ian Lance Taylor wrote:
> On Thu, Aug 13, 2020 at 12:01 PM Corey Gilmore
> wrote:
> >
> > Setup:
> > - Go 1.15
> > - https://github.com/mattn/go-sqlite3 SQL d
Just upgraded from 1.12 to 1.15 and ran into this as well. What about those
of us who can't so easily upgrade the version of MingW we're using?
Is there no way to disable that option when building cgo projects from the
command-line? If not, does 1.14 use it, or do I have to go back even
farther
On 8/14/20 11:27, 'Carla Pfaff' via golang-nuts wrote:
This has nothing to do with modules. You're still using the old GOPATH
mode, because you're not in a directory with a go.mod file. GOPATH
defaults to $HOME/go when it's not set (since 1.8), but that's where
you chose to put your Go installa
This has nothing to do with modules. You're still using the old GOPATH
mode, because you're not in a directory with a go.mod file. GOPATH defaults
to $HOME/go when it's not set (since 1.8), but that's where you chose to
put your Go installation. This is not allowed. Either install Go to a
diffe
On 8/14/20 11:20, Jan Mercl wrote:
[External Email. Be cautious of content]
On Fri, Aug 14, 2020 at 8:03 PM 'K Richard Pixley' via golang-nuts
wrote:
What am I missing?
package github.com/mna/pigeon: cannot download, $GOPATH must not be set to
$GOROOT. For more details see: 'go help gopath'
On Fri, Aug 14, 2020 at 8:03 PM 'K Richard Pixley' via golang-nuts
wrote:
> What am I missing?
> package github.com/mna/pigeon: cannot download, $GOPATH must not be set to
> $GOROOT. For more details see: 'go help gopath'
The above is the problem
> GOPATH="/homes/kpixley/go"
> GOROOT="/homes
I'm consistently finding modules confusing.
Here's today's confusion. I /think/ I've eliminated local environment
settings but, once done, go get isn't working and I don't understand
what needs to be changed. What am I missing?
kpixley@editsb> type go
-bash: type: go: not found
kpixley@edit
On Fri, Aug 14, 2020 at 6:17 PM Joe Marty
wrote:
> Yeah, I can see how the convention of "always testing for failure" is
> better than a panic, in that it requires you to handle the possibility of a
> failure for things that may commonly fail. In that respect though, I don't
> understand why the
Hello Gophers,
I want to list modules available only for available only patch upgrades.
The given example here
https://github.com/golang/go/wiki/Modules#how-to-upgrade-and-downgrade-dependencies
is
for direct with minor and patch (I just want patch)
I want use this in my CI with https://github
i find the reference code in cmd/compile/internal/gc/reflect.go
On Friday, August 14, 2020 at 8:52:54 PM UTC+8 Volker Dobler wrote:
> On Friday, 14 August 2020 13:00:19 UTC+2, xie cui wrote:
>>
>> the return instance of reflect.TypeOf(some object) should be generate by
>> compiler, the type info
Thanks for the insights!
Yeah, I can see how the convention of "always testing for failure" is
better than a panic, in that it requires you to handle the possibility of a
failure for things that may commonly fail. In that respect though, I don't
understand why the "comma OK" is optional. Elm,
> Turns out it takes some time to release the lock on the folder, so we
should do some time.Sleep before the os.Remove, so that Windows can release
the lock.
I do not believe that should be the case under normal Windows operation.
Using a Sleep in a case like this is always a hack. Sometimes
i'm trying to create an object file by using "go build" for GOOS=linux
GOARCH=386.
My current go environment has GOOS=linux GOARCH=amd64.
i know that go build directly builds and links the files, but i want to link
files using an external linker file, so i need only the object file to be
create
But those two lines don't do much, the first line reads the type pointer
out of the interface, and the function toType is just a nil check:
https://golang.org/src/reflect/type.go?s=38892:38923#L2963
I'm guessing xie cui is looking for where the instances of for example
structType: https://golan
Hello guys, I have solved the issue.
Turns out it takes some time to release the lock on the folder, so we
should do some time.Sleep before the os.Remove, so that Windows can release
the lock.
Thank you both for replying.
14 Ağustos 2020 Cuma tarihinde saat 16:21:17 UTC+3 itibarıyla
jake...@
This works fine for me on Windows 10.
What is "my.exe" doing?
Do you have third party antivirus software? If so, try turning it off. They
are notorious for causing this kind of problem.
On Friday, August 14, 2020 at 5:02:36 AM UTC-4 atakanc...@gmail.com wrote:
> Hello dear fellow gophers,
>
On Friday, 14 August 2020 13:00:19 UTC+2, xie cui wrote:
>
> the return instance of reflect.TypeOf(some object) should be generate by
> compiler, the type info which could be in elf files. i want to known where
> compiler generate it.
>
Maybe this is the reason for your confusion.
Your assumptio
i am reading gc's code. i just need to know. reflect.TypeOf return a
interface, the interface ref to a instance or call data. that instance
should be generate by compiler. but i can not find where is the compiler
code that generate data about type.
On Friday, August 14, 2020 at 7:00:19 PM UTC+8
the return instance of reflect.TypeOf(some object) should be generate by
compiler, the type info which could be in elf files. i want to known where
compiler generate it.
On Friday, August 14, 2020 at 5:08:30 PM UTC+8 Volker Dobler wrote:
> On Friday, 14 August 2020 08:15:03 UTC+2, xie cui wrot
Thank you for your reply. Unfortunately taskkill returns 128
buffer, err := exec.Command("my.exe", myArgs...).Output() // err is nil
here, I get desired output
_, err := exec.Command("taskkill", "/F", "/im", "my.exe").Output() // err
is exit code 128, tried same with /pid, cmd.Process.Pid as we
On Thu, 13 Aug 2020 at 23:30, Ian Lance Taylor wrote:
> On Thu, Aug 13, 2020 at 3:09 PM roger peppe wrote:
> >
> > I do feel that the "all or nothing" nature of type parameter lists (if
> you specify one type parameter, you must explicitly specify all of the
> others too, even if they could othe
Windows locks the running program's file, you cannot delete it when it's
running - use "taskkill /F" to kill it proper.
atakanc...@gmail.com a következőt írta (2020. augusztus 14., péntek,
11:02:36 UTC+2):
> Hello dear fellow gophers,
>
> I had a relatively simple yet quite inconvenient issue
On Friday, 14 August 2020 08:15:03 UTC+2, xie cui wrote:
>
>
> how can i see the code genrate by compiler, and where is the compiler code
> to generate these code(which file, which function). i am just curious.
Can you explain what you mean exactly by "code generated by the compiler"?
Are you i
Hello dear fellow gophers,
I had a relatively simple yet quite inconvenient issue which I felt the
need to ask here. In my main() function;
os.Remove("my.exe") // err is nil, my.exe is removed
works in Windows without any errors, but when I call exec beforehand, I get
access is denied error;
40 matches
Mail list logo