[go-nuts] Re: Why Does $GOPATH/src Not Exist?

2025-02-23 Thread peterGo
Go Wiki: GOPATH https://go.dev/wiki/GOPATH peter On Sunday, February 23, 2025 at 9:59:13 AM UTC-5 peterGo wrote: > On Saturday, February 22, 2025 at 7:52:53 PM UTC-5 Björn Försterling wrote: > > Hello, > > according to "The Go Programming Lanuage" (A

[go-nuts] Re: Why Does $GOPATH/src Not Exist?

2025-02-23 Thread peterGo
On Saturday, February 22, 2025 at 7:52:53 PM UTC-5 Björn Försterling wrote: Hello, according to "The Go Programming Lanuage" (Alan A. A. Donovan/Brian W. Kernighan) page 291 the "GOPATH" should have a subdirectory named "src". However that dir is not present on my system: The Go programming

[go-nuts] Go Module Mirror

2025-02-05 Thread peterGo
Go Module Mirror FYI Go Supply Chain Attack: Malicious Package Exploits Go Module Proxy Caching for Persistence https://socket.dev/blog/malicious-package-exploits-go-module-proxy-caching-for-persistence Go Module Mirror served backdoor to devs for 3+ years https://arstechnica.com/

[go-nuts] Go 1.24 BLooper

2025-01-20 Thread peterGo
Go 1.24 introduces B.Loop() to replace B.N. https://pkg.go.dev/testing@go1.24rc2#B.Loop https://pkg.go.dev/testing@go1.24rc2#B testing: add testing.B.Loop for iteration #61515 https://github.com/golang/go/issues/61515 As suggested by @rsc, b.Loop could be a clear signal to the com

Re: [go-nuts] Re: How to know if interface{} data is nil w/o reflecting?

2024-09-26 Thread peterGo
Mike, Correction: FAQ s/b CodeReviewComments peter On Thursday, September 26, 2024 at 7:08:25 AM UTC-4 peterGo wrote: > Mike, > > The Go FAQ begins with "Go interfaces generally ...". > > Go documentation is written in American English. > > generally adverb >

Re: [go-nuts] Re: How to know if interface{} data is nil w/o reflecting?

2024-09-26 Thread peterGo
Mike, The Go FAQ begins with "Go interfaces generally ...". Go documentation is written in American English. generally adverb : in a general manner: such as a : in disregard of specific instances and with regard to an overall picture generally speaking b : as a rule : usually https://www.mer

Re: [go-nuts] Suppress GoFmt-generated error with/tools.go?

2024-08-31 Thread peterGo
will look into that for longer term. > > Shorter term, though it would be nice to find a way to resolve this. > > On Aug 30, 2024, at 9:14 AM, peterGo wrote: > > Let's use official Go sources. > > go/src/cmd/tools/tools.go: > > Indent the tools.go import s

[go-nuts] Re: Suppress GoFmt-generated error with/tools.go?

2024-08-30 Thread peterGo
Mike, Let's use official Go sources. go/src/cmd/tools/tools.go: $ go version go version devel go1.24-0f003f9d15 Thu Aug 29 09:15:06 2024 + linux/amd64 $ $ cat tools.go // Copyright 2023 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license t

Re: [go-nuts] Re: Possible issue with go vet and/or gopls

2024-08-25 Thread peterGo
vet no longer does. This also appears to me to be an issue, though a lot > harder to diagnose because I can only observe the outcome via the black box > of vscode (or another editor configured with gopls). I do not know how to > run gopls as a standalone tool on a file (I do not eve

Re: [go-nuts] Re: Possible issue with go vet and/or gopls

2024-08-25 Thread peterGo
the black box > of vscode (or another editor configured with gopls). I do not know how to > run gopls as a standalone tool on a file (I do not even know if such a > thing is possible). > > -- > Arnaud > > On Sun, 25 Aug 2024 at 18:10, peterGo wrote: > >> A

[go-nuts] Re: Possible issue with go vet and/or gopls

2024-08-25 Thread peterGo
Arnaud, $ go version && go run alias.go && go vet alias.go go version devel go1.24-96d8ff00c2 Sat Aug 24 00:51:40 2024 + linux/amd64 b = {X:0xc00011c190 Y:0xc00011c1a0} $ Or $ go1.23 version && go1.23 run alias.go && GODEBUG=gotypesalias=1 go1.23 vet alias.go go version go1.23.0 linux/amd

[go-nuts] Re: runtime swiss maps

2024-08-17 Thread peterGo
Leah Stapleton, Is Go 1.24 open for development? Yes Tree status for the Go 1.23 release and Go 1.24 development https://groups.google.com/g/golang-dev/c/or4BmCu3LIE/m/a1Hv1yoxBAAJ The tree is now open for general development of Go 1.24. It will remain open until the freeze begins on Nov

Re: [go-nuts] After Disbanding the Python Team, Google’s Go Team Faces Turmoil: Technical Lead and 12-Year Project Leader Steps Down

2024-08-15 Thread peterGo
Ian, Gemini and ChatGPT are always good for a laugh. I gave Gemini a prompt of "Is this true?" followed by the text of the article. The Gemini results summary: Overall Assessment The information you presented aligns with credible news reports and public discussions about these events. The de

[go-nuts] Re: After Disbanding the Python Team, Google’s Go Team Faces Turmoil: Technical Lead and 12-Year Project Leader Steps Down

2024-08-15 Thread peterGo
Amnon, The final two sentences should allow you to piece together the entire article: "Russ Cox has managed Google’s Go language for over 12 years and worked at the company for more than 18 years. He is one of the original members of the Go language team." You are spreading misinformation cli

[go-nuts] Re: photoslibrary/v1 no longer available

2024-08-01 Thread peterGo
ry at v0.3.2." https://go.dev/play/p/ybb5mAMAj9e peter Regards, Pratik Tamgole. On Wednesday, July 31, 2024 at 7:30:37 PM UTC+5:30 peterGo wrote: Pratik Tamgole Changes https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md v0.4.0 Deletes photoslibrary/v1. The photoslibrary

[go-nuts] Re: photoslibrary/v1 no longer available

2024-07-31 Thread peterGo
Pratik Tamgole Changes https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md v0.4.0 Deletes photoslibrary/v1. The photoslibrary team hopes to fully support Go in the near future, but this autogenerated library is ready to be sunset. If you rely on this client, please vendor t

[go-nuts] Re: photoslibrary/v1 no longer available

2024-07-31 Thread peterGo
Pratik Tamgole Changes https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md v0.4.0 Deletes photoslibrary/v1. The photoslibrary team hopes to fully support Go in the near future, but this autogenerated library is ready to be sunset. If you rely on this client, please vendor t

[go-nuts] Re: photoslibrary/v1 no longer available

2024-07-31 Thread peterGo
Pratik Tamgole, Changes https://groups.google.com/g/golang-nuts/c/e7LnsRmTWrg v0.4.0 Deletes photoslibrary/v1. The photoslibrary team hopes to fully support Go in the near future, but this autogenerated library is ready to be sunset. If you rely on this client, please vendor this library at v0

[go-nuts] Re: When using cgo to generate Go structs, some fields are ignored in the definition.

2024-07-24 Thread peterGo
Repeat of post on Stack Overflow: https://stackoverflow.com/questions/78786971/why-do-some-fields-in-the-go-structs-generated-using-cgo-become-anonymous On Wednesday, July 24, 2024 at 8:29:39 AM UTC-4 飞舟 wrote: > I have a C struct, and when I use cgo to generate Go structs, some fields > ar

[go-nuts] Re: Is []rune(invalidUTF8str) underspecified?

2024-07-09 Thread peterGo
On Tuesday, July 9, 2024 at 3:42:51 PM UTC-4 David Anderson wrote: I've been going over the spec to clarify finer points of how string vs. []byte behave, In https://go.dev/ref/spec#Conversions, `[]rune(str)` is specified as: "Converting a value of a string type to a slice of runes type yields

[go-nuts] Re: Is []rune(invalidUTF8str) underspecified?

2024-07-09 Thread peterGo
On Tuesday, July 9, 2024 at 3:42:51 PM UTC-4 David Anderson wrote: I've been going over the spec to clarify finer points of how string vs. []byte behave, I think there may be an unnecessary degree of freedom that could be removed. Either that, or I missed a load-bearing statement that constrai

Re: [go-nuts] Does data race with only multiple goroutine parallel i=1 have an impact on the execution results?

2024-07-06 Thread peterGo
On Saturday, July 6, 2024 at 11:21:46 AM UTC-4 Robert Engels wrote: That is not a data race. The wait group is a synchronization barrier. == WARNING: DATA RACE Write at 0x00c14158 by goroutine 8: main.main.func1() /home/peter/racer.go:12 +0x84 Previous write at 0x00

Re: [go-nuts] Preserving special characters when reading Go POST request body

2024-07-02 Thread peterGo
Ian, Hugh Myrie might be expecting to see something like this: https://go.dev/play/p/7TlD5R1C0oX Peter On Tuesday, July 2, 2024 at 9:53:41 PM UTC-4 Ian Lance Taylor wrote: On Tue, Jul 2, 2024 at 5:29 PM Hugh Myrie wrote: When I change the %s to %q in the print function I see the special cha

Re: [go-nuts] go clean -h isn't helpful

2024-06-22 Thread peterGo
Will, The help system for go commands is provided by the help subcommand. $ go help For example, $ go test -h usage: go test [build/test flags] [packages] [build/test flags & test binary flags] Run 'go help test' and 'go help testflag' for details. $ If you want to change

Re: [go-nuts] Re: Call the .net dlls into the golang

2024-05-22 Thread peterGo
cgo command https://pkg.go.dev/cmd/cgo Cgo enables the creation of Go packages that call C code. On Wednesday, May 22, 2024 at 4:41:13 PM UTC-4 Carla Pfaff wrote: > Yes, you can call C functions from Go, it's called Cgo: > https://go.dev/blog/cgo > > On Wednesday 22 May 2024 at 18:04

Re: [go-nuts] Calling the .net dlls to the golang

2024-05-21 Thread peterGo
Kurtis Rader, The OP's question: "I am new to Golang. I have the.net dlls, and I am trying to call the.net function in the dll in Golang. but its not working and i searching in the Google also i could not find the relavent information, please me out here and provide the sample program also" Th

Re: [go-nuts] Calling the .net dlls to the golang

2024-05-21 Thread peterGo
Kurtis Rader, Please follow the Go Community Code of Conduct while posting here. In short: - Treat everyone with respect and kindness. - Be thoughtful in how you communicate. - Don’t be destructive or inflammatory. - You are fired from your self-app

[go-nuts] Re: replacement for filepath.HasPrefix?

2024-05-16 Thread peterGo
Jochen, "the first step is to define exactly what the function should do." path/filepath: fix HasPrefix #18358 https://github.com/golang/go/issues/18358#issuecomment-497728574 Peter On Thursday, May 16, 2024 at 7:15:45 AM UTC-4 Jochen Voss wrote: > Dear all, > > filepath.HasPrefix is deprecate

[go-nuts] Re: question about src/cmd/go/internal/script/cmds_posix.go and windows

2024-05-13 Thread peterGo
Hiroaki, go/src/cmd/go/internal/test/test_nonunix.go //go:build !unix package test func isETXTBSY(err error) bool { // syscall.ETXTBSY is only meaningful on Unix platforms. return false } peter On Monday, May 13, 2024 at 4:32:38 AM UTC-4 hnak...@gmail.com wrote: > Hi, > I found that > > http

[go-nuts] Re: question about src/cmd/go/internal/script/cmds_posix.go and windows

2024-05-13 Thread peterGo
Hiroaki, go/src/syscall/zerrors_windows.go // Invented values to support what package os and others expects. const ( ... ETXTBSY ... ) peter On Monday, May 13, 2024 at 4:32:38 AM UTC-4 hnak...@gmail.com wrote: > Hi, > I found that > > https://github.com/golang/go/blob/07fc59199b9522bfe0d14f35c4

[go-nuts] Re: range-over-func has two more alloc than direct-call-func Why?

2024-03-12 Thread peterGo
qiulaidongfeng, -gcflags=-m=2 peter On Tuesday, March 12, 2024 at 7:06:21 AM UTC-4 qiulaidongfeng wrote: > For the following code > > > https://go.dev/play/p/ynn7ihKXrp0?v=gotip > > > I got the benchmark > > > BenchmarkBelow3-16 9523 147772 ns/op 17 B/op 2 allocs/op > > BenchmarkBelow3direct-16

[go-nuts] Re: Why is more memory being used when encoding a slice of structs with smaller length

2024-03-11 Thread peterGo
Also posted on Stack Overflow: Why is more memory being used when encoding a slice of structs with smaller length https://stackoverflow.com/questions/78136093/why-is-more-memory-being-used-when-encoding-a-slice-of-structs-with-smaller-leng On Monday, March 11, 2024 at 12:3

golang-nuts@googlegroups.com

2024-03-06 Thread peterGo
Matheus, Rewire your brain. The return value or values may be explicitly listed in the "return" statement. Each expression must be single-valued and assignable to the corresponding element of the function's result type. The Go Programming Language Specification https://go.dev/ref/spec#Return_s

[go-nuts] Re: 64 Tiny Algorithmic Puzzles in Go

2024-03-02 Thread peterGo
qiulaidongfeng, A simpler, solution: https://go.dev/play/p/gLY7O_hwyxI peter On Saturday, March 2, 2024 at 8:25:33 PM UTC-5 qiulaidongfeng wrote: > I wrote a correct one, as shown here: > https://go.dev/play/p/IDJP_iIsGDE > > On Sunday, March 3, 2024 at 1:42:51 AM UTC+8 BUGFIX 66 wrote: > >> h

Re: [go-nuts] Re: new range over int docs?

2024-02-07 Thread peterGo
uary 2024 at 12:02:28 UTC Rob Pike wrote: > >> Ha ha, someone forgot to change the year. It should read Jan 30, 2024. >> >> That's confusing. >> >> -rob >> >> >> On Wed, Feb 7, 2024 at 8:47 PM peterGo wrote: >> >>> Jason, >

Re: [go-nuts] Re: new range over int docs?

2024-02-07 Thread peterGo
7bb7cd0756bac https://cs.opensource.google/go/go/+/release-branch.go1.22:doc/go_spec.html I consider the Go source code to be the truth. What are you looking at? Peter On Wednesday, February 7, 2024 at 1:17:25 AM UTC-5 Jason E. Aten wrote: > On Wed, Feb 7, 2024 at 3:34 AM peterGo wrote:

[go-nuts] Re: new range over int docs?

2024-02-06 Thread peterGo
Jason, The Go specification "Length and capacity" section defines the len built-in function. Peter On Tuesday, February 6, 2024 at 11:36:21 PM UTC-5 peterGo wrote: > Jason, > > The Go 1.22 specification, in part, > > For statements with range clause > > A "

[go-nuts] Re: new range over int docs?

2024-02-06 Thread peterGo
r an integer value n, the iteration values 0 through n-1 are produced in increasing order. If n <= 0, the loop does not run any iterations. Peter On Tuesday, February 6, 2024 at 10:34:07 PM UTC-5 peterGo wrote: > Jason, > > The Go Programming Language Specification is reference docume

[go-nuts] Re: new range over int docs?

2024-02-06 Thread peterGo
Jason, The Go Programming Language Specification is reference documentation. It is intended to be read very carefully in its entirety. You are reading a specification dated Version of Aug 2, 2023. The current specification for Go 1.22 is dated as Modified Tue 06 Feb 2024 10:08:15 PM EST. The

Re: [go-nuts] Re: Passing 2d arrays from Go to C using runtime.Pinner

2024-01-31 Thread peterGo
ink my original > intent was to say that it's OK for Go code to write pinned Go pointers to C > memory. > > Anyway, this needs more thought, since allowing Go code to write Go > pointers to C memory (pinned or not) may end up restricting GC > implementations in a way we don&

[go-nuts] Re: Passing 2d arrays from Go to C using runtime.Pinner

2024-01-29 Thread peterGo
Michael, The OP appears to have lost interest in debugging. Here's my minimal, reproducible example that produces the same fatal errror: https://go.dev/play/p/flEmSh1euqR (run locally) If the runtime.GC() statement is uncommented then the fatal error does not occur. The use of this profli

[go-nuts] Re: It seems that go 1.22 has optimized the implementation of string to byte slicing and no longer requires memory allocation.

2023-11-27 Thread peterGo
Assigning Benchmark results to package variables: var ( str string byt []byte ) BenchmarkString str = string(byteSli) BenchmarkUnsafe str = *(*string)(unsafe.Pointer(&byteSli)) BenchmarkByteStyle byt = []byte(str) BenchmarkWithUnsafe byt = *(*[]byte)(unsafe.Pointer(&bh)) $ go1.21 tes

[go-nuts] Re: GO language best practice document

2023-09-08 Thread peterGo
Go Style | styleguide https://google.github.io/styleguide/go/index peter On Friday, September 8, 2023 at 9:05:12 AM UTC-4 Alexandre Roy wrote: > Hi, > > I want to start a new web application using GO with AWS Lambda, but first > I want to learn the GO language. I mostly have C / Python e

Re: [go-nuts] Best IDE for GO ?

2023-08-19 Thread peterGo
On Saturday, August 19, 2023 at 6:23:39 AM UTC-4 TheDiveO wrote: Nothing better than an IBM card puncher as my IDE! I prefer a Teletype Model 33 ASR. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop rec

[go-nuts] Re: Misleading documentation for time.Timer?

2023-07-05 Thread peterGo
Johan, For https://play.golang.com/p/Kdg-xwmquQO, timer has expired and Reset schedules f to run again and returns false. Documentation reference: https://pkg.go.dev/time#Timer.Reset Reset changes the timer to expire after duration d. It returns true if the timer had been active, false if the

Re: [go-nuts] Re: Amateur's questions about "Go lang spec"

2023-06-03 Thread peterGo
check how well people read examples in it. > > Best regards, > Kamil > sobota, 3 czerwca 2023 o 21:52:37 UTC+2 burak serdar napisał(a): > >> On Sat, Jun 3, 2023 at 1:40 PM peterGo wrote: >> >>> >>> Kamil Ziemian, >>> >>> // list of p

Re: [go-nuts] Re: Amateur's questions about "Go lang spec"

2023-06-03 Thread peterGo
Kamil Ziemian, // list of prime numbers primes := []int{2, 3, 5, 7, 9, 2147483647} The variable prime is a list of some prime numbers starting with the lowest and ending with the highest prime numbers that can safely be represented an int. An int may either 32 or 64 bits. Please explain the

Re: [go-nuts] Re: https://go-talks.appspot.com still working?

2023-05-13 Thread peterGo
ot;https://api.github.com/users/jum/orgs";, "repos_url": "https://api.github.com/users/jum/repos";, "events_url": "https://api.github.com/users/jum/events{/privacy}";, "received_events_url": "https://api.github.com/users/jum/rece

[go-nuts] Re: https://go-talks.appspot.com still working?

2023-05-13 Thread peterGo
It is your error. https://go-talks.appspot.com/github.com/jum/htempl/slides/htempl.slide takes me to https://go-talks.appspot.com/github.com/jum/htempl/slides/htempl.slide#1 the slide deck. peter On Saturday, May 13, 2023 at 10:17:18 AM UTC-4 Jens-Uwe Mager wrote: > I tried an older URL of mi

[go-nuts] Re: RLIM_INFINITY for loong64 has a special type.

2023-04-05 Thread peterGo
The issue seems clear. syscall.RLIM_INFINITY for loong64 does not have a special type. syscall.RLIM_INFINITY for loong64 (0x) is a reasonable ordinary value for type rlim_t (uint64). Prometheus has a bug. --- The Open Group Base Specifications Issue 7, 2018 edition https://p

[go-nuts] Re: Naming conventions in go?

2023-03-04 Thread peterGo
Lenny,' Go Code Review Comments Variable Names https://github.com/golang/go/wiki/CodeReviewComments#variable-names Google Style Guides Go Style Variable names https://google.github.io/styleguide/go/decisions#variable-names What's in a name? https://talks.golang.org/2014/names.slide Names https:

[go-nuts] Re: heap profiling does not work on M2 MacBook air?

2023-03-02 Thread peterGo
On Thursday, March 2, 2023 at 2:03:22 AM UTC-5 Jochen Voss wrote: Hi Peter, Thanks a lot, giving the "-alloc_space" option makes all the difference! With this option, it also works for me. I wonder whether it meant to be the way that you have to give this option. Maybe something broke? In t

[go-nuts] Re: heap profiling does not work on M2 MacBook air?

2023-03-01 Thread peterGo
Jochen Voss, On linux/amd64 xxx.go: https://go.dev/play/p/Wq_OU49LVQZ $ go build xxx.go && ./xxx $ go tool pprof xxx mem.prof File: xxx Type: inuse_space Time: Mar 1, 2023 at 11:03pm (EST) No samples were found with the default sample value type. Try "sample_index" command to analyze different

Re: [go-nuts] Remove digits from string

2022-12-30 Thread peterGo
:35:10 AM UTC-5 Brian Candler wrote: > > https://go.dev/play/p/WxKPohZhbrE > > > On Thursday, 29 December 2022 at 22:12:47 UTC peterGo wrote: > >> https://go.dev/play/p/F6gNFWjRzGO >> >> >> On Thursday, December 29, 2022 at 12:50:34 PM UTC-5 Mitul sharma

Re: [go-nuts] Remove digits from string

2022-12-29 Thread peterGo
https://go.dev/play/p/F6gNFWjRzGO On Thursday, December 29, 2022 at 12:50:34 PM UTC-5 Mitul sharma wrote: > Hello, > > I'm stuck in below code snippet, looking to have a output as string > without any digits. > Input : "H1e5ll0o" > Output: "Hello" > > I tried with *output := strings.Replace(str

[go-nuts] Re: glog - Security Vulnerability Report

2022-12-06 Thread peterGo
Please follow the Go Security Policy: https://go.dev/security/policy All security bugs in the Go distribution should be reported by email to secur...@golang.org. This mail is delivered to the Go Security team. On Tuesday, December 6, 2022 at 6:44:37 PM UTC-5 Marco Arboleda wrote: > Good after

[go-nuts] Re: Go Memory Model question

2022-12-02 Thread peterGo
Programs that modify data being simultaneously accessed by multiple goroutines must serialize such access. https://go.dev/ref/mem $ go run -race racer.go 00 == WARNING: DATA RACE Write at 0x0054d5f8 by goroutine 6: main.main.func1() /home/peter/racer.go:7 +0x29

[go-nuts] NSA recommends using memory safe languages like Go

2022-11-11 Thread peterGo
FYI The US National Security Agency (NSA) published guidance today to help software developers and operators prevent and mitigate software memory safety issues, which account for a large portion of exploitable vulnerabilities. https://www.nsa.gov/Press-Room/News-Highlights/Article/Article/3215

Re: [go-nuts] Goroutine to thread mapping

2022-11-08 Thread peterGo
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

Re: [go-nuts] Re: How to make the first character in a string lowercase?

2022-11-04 Thread peterGo
Prithu Adhikary, As I pointed out earlier, your code only works when the first character is ASCII. For example, it does not work for the Greek alphabet, it does not work for an empty string. https://groups.google.com/g/golang-nuts/c/WfpmVDQFecU/m/CQiT04mRAQAJ Peter On Friday, November 4, 2022

[go-nuts] Re: There is a passage in book that is difficult to understand, can anyone help explain it?

2022-11-02 Thread peterGo
Guanyun, I tried to think of a simple example. type Average struct { sum float64 count int64 mxsync.Mutex } https://go.dev/play/p/4SLCLuqG246 1. An invariant represents a condition that does not change while the process progresses - Niklaus Wirth. 2. The additional invariant

[go-nuts] Re: Issue with go-git API

2022-10-10 Thread peterGo
Follow the instructions in the error messages: see `go help modules`. On Monday, October 10, 2022 at 1:35:38 AM UTC-4 princ...@gmail.com wrote: > I am trying to use this git api(*https://github.com/go-git/go-git > *), but before that I tried to run the > provid

Re: [go-nuts] Re: Question on 'cmd/compile: handle partially overlapping assignments' behavior on ARM64.

2022-09-20 Thread peterGo
Jan, An obvious typo. Read my original message: "I am unable to reproduce your results on AMD64" peter On Tuesday, September 20, 2022 at 12:14:32 PM UTC-4 Jan Mercl wrote: > On Tue, Sep 20, 2022 at 6:02 PM peterGo wrote: > > > Yes, I read that too. A fundament

[go-nuts] Re: Question on 'cmd/compile: handle partially overlapping assignments' behavior on ARM64.

2022-09-20 Thread peterGo
Brian, Yes, I read that too. A fundamental tenet of science is reproducibility. I was able to reproduce the AMD64 results and documented it. A step forward. peter On Tuesday, September 20, 2022 at 11:35:58 AM UTC-4 Brian Candler wrote: > On Tuesday, 20 September 2022 at 16:24:41 UTC+1 pete

[go-nuts] Re: Question on 'cmd/compile: handle partially overlapping assignments' behavior on ARM64.

2022-09-20 Thread peterGo
I am unable to reproduce your results on AMD64. I don't see any regression. Run your benchmarks with option -benchmem. Version: devel go1.20-1eeb257b88 Tue Sep 20 02:58:09 2022 + Sizeof(Array{}): 16 Sizeof(int(0)): 8 goarch: amd64 BenchmarkSliceOfInt-4391646 2583 ns/op 8192 B/op 1 all

[go-nuts] Re: private go documentation server similar to https://pkg.go.dev

2022-09-10 Thread peterGo
https://go.googlesource.com/pkgsite/ On Saturday, September 10, 2022 at 5:28:35 PM UTC-4 brainman wrote: > Hello Everyone, > > I would like to run go documentation server that have access to my private > code. > > Is it possible to do? > > I am happy to run the server myself, if it is easy to se

[go-nuts] Re: Benchmarks in https://github.com/golang/go

2022-08-07 Thread peterGo
For example, ~$ git clone https://github.com/golang/go --depth 1 $HOME/bench Cloning into '/home/peter/bench'... # . . . ~$ cd $HOME/bench/src ~/bench/src$ ./make.bash # . . . Installed Go for linux/amd64 in /home/peter/bench Installed commands in /home/peter/bench/bin ~/bench/src$ cd $HOME/bench/

[go-nuts] Re: goroutine private / local var/const

2022-07-19 Thread peterGo
Are you looking for somthing like this? https://go.dev/play/p/_nERkkLC94h peter On Tuesday, July 19, 2022 at 12:14:14 PM UTC-4 agra...@googlemail.com wrote: > hi, > > for i=0;i<10;i++ { go func () { /* const c=i OR var v=i */ > fmt.Println("f:beg i=",i) // here c or v instead > // action >

[go-nuts] Re: Is Go 1.19 the last 1.x release?

2022-07-16 Thread peterGo
Natasha, No. Planning Go 1.20 https://groups.google.com/g/golang-dev/c/Lu5pEF8iwV0/m/62gDPmzaBwAJ Peter On Saturday, July 16, 2022 at 8:19:58 AM UTC-4 natasha.s...@gmail.com wrote: > As once somewhat hinted by Russ Cox . > -- You received this message

[go-nuts] Re: fmt package documentation

2022-07-05 Thread peterGo
Other flags is fixed in Go 1.19: https://pkg.go.dev/fmt@go1.19beta1 Peter On Tuesday, July 5, 2022 at 5:47:55 PM UTC-4 ben...@gmail.com wrote: > At the default URL https://pkg.go.dev/fmt the same thing happens for me > too. However, at https://pkg.go.dev/fmt@master it formats correctly > (pre-

[go-nuts] Re: what is tab itab short for?

2022-06-23 Thread peterGo
Go Data Structures: Interfaces - Russ Cox https://research.swtch.com/interfaces "The first word in the interface value points at what I call an interface table or itable (pronounced i-table; in theruntime sources, the C implementation name is Itab)." Peter On Thursday

[go-nuts] Re: what is //go:build difference from //+build?

2022-06-16 Thread peterGo
This information is in the release notes. Go 1.17 Release Notes https://go.dev/doc/go1.17 //go:build lines The go command now understands //go:build lines and prefers them over // +build lines. The new syntax uses boolean expressions, just like Go, and should be less error-prone. As of this re

[go-nuts] Re: what is //go:build difference from //+build?

2022-06-16 Thread peterGo
Bug-resistant build constraints — Draft Design Russ Cox June 30, 2020 https://go.googlesource.com/proposal/+/master/design/draft-gobuild.md Peter On Wednesday, June 15, 2022 at 10:37:16 PM UTC-4 cuiw...@gmail.com wrote: > about when these feature add to golang? > and is all we can do with //g

[go-nuts] Re: biostuff: computational biology packages for Go

2022-05-09 Thread peterGo
Amit, I know of a university professor and a university lecturer who use Go for computational biology. They solve some interesting computer science problems. You say your code is efficient: https://pkg.go.dev/github.com/fluhus/biostuff I looked at your code and picked something simple:

[go-nuts] Re: testing examples printing to stdout not working for global var

2022-05-02 Thread peterGo
ul comments. please don't get huffy i don't have the > time/interest, just don't comment anymore. > > On Monday, 2 May 2022 at 03:32:46 UTC+1 peterGo wrote: > >> It looks like you have a bug in your code. >> >> "In tests, standard output is accumu

[go-nuts] Re: testing examples printing to stdout not working for global var

2022-05-01 Thread peterGo
It looks like you have a bug in your code. "In tests, standard output is accumulated during execution and dumped to standard output when done." "Example functions may include a concluding line comment that begins with "Output:" and is compared with the standard output of the function when the

Re: [go-nuts] Possible fuzz testing issue on Windows

2022-04-25 Thread peterGo
On Monday, April 25, 2022 at 2:12:35 AM UTC-4 kortschak wrote: > I have sent https://go-review.googlesource.com/c/go/+/402074 to address > this. > > Dan, For the second and subsequent lines, for _, line := range lines[1:] { line = bytes.TrimSpace(line) // ... } Did you consider be

Re: [go-nuts] Generics faster than native float64?

2022-04-19 Thread peterGo
As Ian has pointed out, software and hardware optimizations may distort the results of microbenchmarks. If I run the original benchmarks using go1.18 and go1.19 the Copy and CopyG ns/op results are reversed. # Original: https://go.dev/play/p/m1ClnbdbdWi ~/x$ go1.18 version && go1.18 test x_0_t

[go-nuts] Re: MaxDiskSize MaxLogCount for glog?

2022-04-08 Thread peterGo
On Thursday, April 7, 2022 at 2:27:06 PM UTC-4 Jack Li wrote: > Hi group, > > Can glog support the options like how many disk size (ie. 10%, 1.8G, etc.) > all the log files may use in total, and the count (ie. 10) of log files it > can save. For example, logfile1.txt, logfile2.txt, ..., logfil

[go-nuts] Re: Convert string to time.Duration

2022-04-03 Thread peterGo
func addHours(t time.Time, hours string) (time.Time, error) { i, err := strconv.ParseInt(hours, 10, 64) if err != nil { return time.Time{}, err } return t.Add(time.Hour * time.Duration(i)), nil } https://go.dev/play/p/jjLO54tbJn4 Peter On Sunday, April 3, 2022 at 6:48:54

Re: [go-nuts] Re: "\x7f"

2022-03-30 Thread peterGo
Unicode Standard http://www.unicode.org/versions/latest/ C0 Controls and Basic Latin Range: –007F https://unicode.org/charts/PDF/U.pdf Control character 007F  = DELETE Peter On Thursday, March 31, 2022 at 1:40:53 AM UTC-4 zachmc...@gmail.com wrote: > 9 years in the future: > > This is

[go-nuts] Re: about keyword constraint?

2022-03-20 Thread peterGo
For background information, Featherweight Go The Go language famously lacks generics. Our paper introduces a core formal model of Go, Featherweight Go (FG), and explores a design of generics for FG featuring structural typing (Featherweight Generic Go). The semantics of generics are defined vi

[go-nuts] Re: Goroutines - handles, signals, and signal handlers

2022-03-17 Thread peterGo
Go1.18 has a new Mutex TryLock method. https://pkg.go.dev/sync@go1.18#Mutex.TryLock Petr On Wednesday, March 16, 2022 at 9:36:50 PM UTC-4 mumbling...@gmail.com wrote: > I'm currently working on a project where I emulate a RISC-V processor for > the purpose of using Go when teaching concepts

[go-nuts] Re: Parsing a time as a prefix of a larger string

2022-03-16 Thread peterGo
On Tuesday, March 15, 2022 at 11:35:06 PM UTC-4 Ben wrote: > We're making a log processing program that needs to parse times from the > prefix of a larger string, in this case in a log line such as: > > 2006-01-02 15:04:05 INFO this is a log message > > We need to parse the "2006-01-02 15:04:05"

Re: [go-nuts] Pointer to a pointer

2022-03-09 Thread peterGo
Kurtis Rader, Stop it. When you are in a hole, stop digging. When you don't understand a question or topic, don't launch ad hominem attacks, calling people's questions silly. That's nasty and it's against the Go Code of Conduct. Like Jan, Rob, and Volker, I found it to be an interesting questi

Re: [go-nuts] Re: DataRace with slice, should i fix it or ignore it?

2022-02-09 Thread peterGo
erent threads." Peter On Wed, Feb 9, 2022 at 9:17 AM peterGo wrote: > Pelen Li, > > Always fix your data races. You should consider the results of data races > as undefined. > > Dmitry Vyukov, who implemented the Go race detector, once wrote an > interesting article with the

[go-nuts] Re: DataRace with slice, should i fix it or ignore it?

2022-02-09 Thread peterGo
Pelen Li, Always fix your data races. You should consider the results of data races as undefined. Dmitry Vyukov, who implemented the Go race detector, once wrote an interesting article with the title: "Benign data races: what could possibly go wrong?" https://twitter.com/dvyukov/status/28885

[go-nuts] Re: golang-announce is blocked in Google Groups?

2022-01-20 Thread peterGo
Jochen, I get that message too. https://groups.google.com/g/golang-announce Google is also trying to lock me out of my gmail accounts, but they do that all the time. I don't think Google puts their best people on security. Peter On Thursday, January 20, 2022 at 6:38:20 AM UTC-5 joche...@gmai

[go-nuts] Re: Q about defer

2021-12-24 Thread peterGo
The Go Programming Language Specification https://go.dev/ref/spec Defer statements https://go.dev/ref/spec#Defer_statements Peter On Friday, December 24, 2021 at 8:34:58 AM UTC-5 muhorto...@gmail.com wrote: > https://play.golang.com/p/lypWMc6Kuff > Why do we get 2 in test() and 1 in another

Re: [go-nuts] Why runtime force gc every 2 minutes?

2021-12-14 Thread peterGo
Getting to Go: The Journey of Go's Garbage Collector Rick Hudson 12 July 2018 https://go.dev/blog/ismmkeynote Peter On Tuesday, December 14, 2021 at 9:05:09 AM UTC-5 peterGo wrote: > There is no right answer to your question. Optimiation is often a > balancing act between comp

Re: [go-nuts] Why runtime force gc every 2 minutes?

2021-12-14 Thread peterGo
There is no right answer to your question. Optimiation is often a balancing act between competing goals, for example, cpu vs menory, speed vs memory safety, different workloads, avoiding worst cases, and so on. Here's a peek at the problem in 2018: https://go.dev/blog/ismmkeynote.Since then, th

[go-nuts] Re: how to control the timezone of time.Now()

2021-10-26 Thread peterGo
Andrei, For database times enforce the use of these convenience functions: func DBNow() time.Time { return DBTime(time.Now()) } func DBTime(t time.Time) time.Time { return t.UTC() } Peter On Tuesday, October 26, 2021 at 2:58:16 PM UTC-4 Andrei Matei wrote: > Hello Go friends, > > I'm

Re: [go-nuts] Re: Questions about documentation of Go standard library

2021-10-06 Thread peterGo
method func (*Regexp) FindIndex ( >>>>> https://pkg.go.dev/reg...@go1.17#Regexp.FindIndex >>>>> <https://pkg.go.dev/regexp@go1.17#Regexp.FindIndex>) we have line >>>>> >>>>> pattern := regexp.MustCompile(`(?m)(?P\w+):\s+(?P\w+)$`) &g

Re: [go-nuts] How to check whether a variable is unreachable?

2021-09-23 Thread peterGo
Package runtime https://pkg.go.dev/runtime Documentation func KeepAlive Note: KeepAlive should only be used to prevent finalizers from running prematurely. Peter On Thursday, September 23, 2021 at 2:23:47 AM UTC-4 c

Re: [go-nuts] How to check whether a variable is unreachable?

2021-09-23 Thread peterGo
$ go vet ch.go # command-line-arguments ./ch.go:19:28: possible misuse of unsafe.Pointer $ https://play.golang.org/p/n9A_sR1yuXC Peter On Thursday, September 23, 2021 at 2:23:47 AM UTC-4 chole...@gmail.com wrote: > Thanks, I see. How about this one? I use a temp variable to store sh.Data, >

[go-nuts] Re: What is up with memo.com?

2021-09-21 Thread peterGo
Ian, I received some gmail from memo.com for a golang-nuts conversation that I participated in. I marked the gmail messages as spam. Peter On Tuesday, September 21, 2021 at 12:11:31 PM UTC-4 Ian Lance Taylor wrote: > I'm seeing random repeats of golang-nuts messages sent from memo.com > with b

[go-nuts] Re: The right way for golang binary to reduce iTLB cache miss

2021-09-17 Thread peterGo
rmfr, What is your data, what is its structure, and what are the access paths and frequencies? Your data is unlikely to be a randomly accessed blob of bits. Is there a set of Pareto access paths that you can use to order your data by access frequency? You want the most frequently accessed data

[go-nuts] Re: Questions about documentation of Go standard library

2021-08-29 Thread peterGo
K, For a finite, unsigned binary number, ignoring leading zeros, how many binary digits (the length in bits) are needed to represent a number? Peter On Sunday, August 29, 2021 at 4:07:41 PM UTC-4 kziem...@gmail.com wrote: > Thank for explanation, but I don't understand "But how many bits do y

Re: [go-nuts] Re: A peculiar sort problem

2021-07-28 Thread peterGo
Tobias, The C# code is likely using the string sort method: SORT_STRINGSORT. winnls.h: //STRING Sort: hyphen and apostrophe will sort with all other symbols // //co-op <--- hyphen (punctuation) //co_op <--- underscore (symbo

[go-nuts] Re: Surprising benchmark result

2021-07-07 Thread peterGo
Revised results using the same input data for each iteration without a copy just a Filter function. i7-7500U name time/op Filter3-4 2.29µs ± 0% Filter4-4 1.51µs ± 0% i5-8250U name time/op Filter3-8 2.30µs ± 0% Filter4-8 1.53µs ± 0% Peter On Wednesday, July 7, 2021 at 11:25:11 A

  1   2   3   >