[go-nuts] thoughts about https://go.dev/blog/loopvar-preview and how to change Go

2024-01-29 Thread Manlio Perillo
is to add a new `feature` field to `go.mod`. As an example: ```go feature ( loopvar error-propagation ) ``` Regards Manlio Perillo -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiv

[go-nuts] Re: Which is the most efficient way to read STDIN lines 100s of MB long and tens of MB info is passed to it?

2022-05-08 Thread Manlio Perillo
You can try to use mmap. Store in memory the start and end/size of a line, so that when a line contains your word, you can pass the address directly to libc.write, using cgo. In alternative, you can create a slice backed by the mapped memory using https://pkg.go.dev/reflect#SliceHeader. Not

Re: [go-nuts] Advice for closed network - problem with go mod

2022-04-26 Thread Manlio Perillo
You can also try using workspace support implemented in Go 1.18. Create a go.work file in ~go/pkg using `go work init` and add all your modules using `go work use -r .` Manlio Perillo On Monday, April 25, 2022 at 11:38:36 PM UTC+2 darse...@gmail.com wrote: > Sean. Brilliant. I don't grasp

[go-nuts] Unexpected failure of go1.18 workspace mode

2022-04-19 Thread Manlio Perillo
I have a project github.com/perillo/xxx, that currently is available only locally. The project has two commands `cmd/a` and `cmd/b`, and some packages with common API use by the two commands. `cmd/a` reads an external file and produces a file that is then used by `cmd/b`. `cmd/b` and the

[go-nuts] playground: about the v query parameter

2022-03-11 Thread Manlio Perillo
The recent version of the playground allows selecting the "Go release" or "Go dev branch" compiler using a drop-down list. The playground also accepts the v query parameter, and, when set, a new "Backend: $v" entry is added to the drop-down. What does Backend means here? Here are some

Re: [go-nuts] Pointer to a pointer

2022-03-10 Thread Manlio Perillo
On Thursday, March 10, 2022 at 2:48:27 PM UTC+1 axel.wa...@googlemail.com wrote: > On Thu, Mar 10, 2022 at 2:38 PM Manlio Perillo > wrote: > >> On Thursday, March 10, 2022 at 2:04:44 PM UTC+1 Jan Mercl wrote: >> >>> On Thu, Mar 10, 2022 at 1:40 PM 'wagner riffe

Re: [go-nuts] Pointer to a pointer

2022-03-10 Thread Manlio Perillo
On Thursday, March 10, 2022 at 2:04:44 PM UTC+1 Jan Mercl wrote: > On Thu, Mar 10, 2022 at 1:40 PM 'wagner riffel' via golang-nuts < > golan...@googlegroups.com> wrote: > > > I don't think it's mentioned in the specification, my bet is that > > unless your type requires inifnity amout of memory

Re: [go-nuts] Pointer to a pointer

2022-03-10 Thread Manlio Perillo
Interesting example, thanks. But how does `type self *self` works? If I remember correctly, it is not discussed in the Language Specification and in The Go Programming Language book. By the way, in C `typedef self *self` is invalid (assuming my code is written correctly). Manlio On

[go-nuts] License of the design documents

2022-02-17 Thread Manlio Perillo
What is the license of the Go design documents? The LICENSE file in the proposal repository is the Go License, but there is no copyright notice in the documents. Thanks Manlio -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

Re: [go-nuts] Move Go 1.2 Field Selectors and Nil Checks to golang.org/design

2022-02-14 Thread Manlio Perillo
On Monday, February 14, 2022 at 11:59:14 PM UTC+1 Ian Lance Taylor wrote: > On Sun, Feb 13, 2022 at 9:18 AM Manlio Perillo > wrote: > > > > Reading htps://golang.org/doc/go1.2, I found that the "Go 1.2 Field > Selectors and Nil Checks" design at >

[go-nuts] Move Go 1.2 Field Selectors and Nil Checks to golang.org/design

2022-02-13 Thread Manlio Perillo
Reading htps://golang.org/doc/go1.2, I found that the "Go 1.2 Field Selectors and Nil Checks" design at https://docs.google.com/document/d/14DgGJKGQeBTNJDXo3YxnlSwv7ouRqvj7BMmZw17vWV0/pub is not available at golang.org/design. Is it possible to move it to the Go proposal repository so that

Re: [go-nuts] Re: Using a local copy of an external package?

2022-02-09 Thread Manlio Perillo
mented the package in go.mod file. > > On Wed, Feb 9, 2022 at 7:07 PM Manlio Perillo > wrote: > >> The `use` directive must be added in the go.work file, not in the go.mod >> file. >> Also, you can use `go work use` command, instead of manually editing the >>

Re: [go-nuts] Re: Using a local copy of an external package?

2022-02-09 Thread Manlio Perillo
> hierarchy : workspace\src\github.com\ipfs\go-bitswap > workspace\src\github.com\ipfs\go-ipfs > > So, in the go-ipfs folder go.mod file I am trying to refer to the > go-bitswap local directory. > > Thank you > Susarla Nikhilesh > On Wed, Feb 9, 2022 at

Re: [go-nuts] Re: Using a local copy of an external package?

2022-02-09 Thread Manlio Perillo
On Wednesday, February 9, 2022 at 9:42:49 AM UTC+1 nikhil...@gmail.com wrote: > I was trying to init the work file as instructed, but I have a package >>> which still doesn't work in 1.18 >>> >>> [image: image.png] >>> So, is there any other alternative? >>> >>> Thank you >>> Susarla Nikhilesh

[go-nuts] Re: Optional dependencies in module

2022-02-08 Thread Manlio Perillo
On Tuesday, February 8, 2022 at 6:22:14 PM UTC+1 arn...@gmail.com wrote: > Hi all, > > Here is my issue: I have a Go module at github.com/arnodel/golua which > implements a Lua compiler / runtime. It has no external dependencies > (strictly, there is a dependency on another small module of

[go-nuts] Re: Using a local copy of an external package?

2022-02-08 Thread Manlio Perillo
On Friday, August 27, 2021 at 12:22:54 AM UTC+2 Paul S. R. Chisholm wrote: > Hypothetical example: Say I'm writing an application that uses " > rsc.io/quote" and I discover a bug in that package that breaks my > software. I would of course clone the quote repository, add a test that >

Re: [go-nuts] Re: generic function with a pointer parameter

2022-01-28 Thread Manlio Perillo
On Thursday, January 27, 2022 at 10:53:52 PM UTC+1 Ian Lance Taylor wrote: > On Thu, Jan 27, 2022 at 1:38 PM Manlio Perillo > wrote: > > > > On Thursday, January 27, 2022 at 11:42:19 AM UTC+1 Manlio Perillo > wrote: > > > [...] > > > > Here is a

Re: [go-nuts] Re: generic function with a pointer parameter

2022-01-27 Thread Manlio Perillo
On Thu, Jan 27, 2022 at 10:00 PM Ian Lance Taylor wrote: > > On Thu, Jan 27, 2022 at 3:13 AM Manlio Perillo > wrote: > > > > On Thursday, January 27, 2022 at 11:42:19 AM UTC+1 Manlio Perillo wrote: > [...] > > Here is an alternate implementation: > > https:

Re: [go-nuts] generic function with a pointer parameter

2022-01-27 Thread Manlio Perillo
On Thu, Jan 27, 2022 at 9:57 PM Ian Lance Taylor wrote: > > On Thu, Jan 27, 2022 at 2:42 AM Manlio Perillo > wrote: > > > > Consider this example, adapted from > > https://github.com/golang/proposal/blob/master/design/43651-type-parameters.md#composite-type

[go-nuts] Re: generic function with a pointer parameter

2022-01-27 Thread Manlio Perillo
..@gmail.com > wrote: > >> On Thursday, January 27, 2022 at 11:42:19 AM UTC+1 Manlio Perillo wrote: >> >>> Consider this example, adapted from >>> https://github.com/golang/proposal/blob/master/design/43651-type-parameters.md#composite-types-in-constraints

[go-nuts] Re: generic function with a pointer parameter

2022-01-27 Thread Manlio Perillo
On Thursday, January 27, 2022 at 11:42:19 AM UTC+1 Manlio Perillo wrote: > Consider this example, adapted from > https://github.com/golang/proposal/blob/master/design/43651-type-parameters.md#composite-types-in-constraints > > (note that the example is incorre

[go-nuts] generic function with a pointer parameter

2022-01-27 Thread Manlio Perillo
Consider this example, adapted from https://github.com/golang/proposal/blob/master/design/43651-type-parameters.md#composite-types-in-constraints (note that the example is incorrect): https://gotipplay.golang.org/p/a8fHVTUpeie The compiler reports an error: ./prog.go:14:9: p.x undefined (type

[go-nuts] Proposal: write a Go Type Parameters Reference document

2022-01-27 Thread Manlio Perillo
Go generics are complex. Currently the only useful documentation (excluding the Go Language Specification) is the original design: golang.org/design/43651-type-parameters. I propose to fork the design document to create a new document "Go Type Parameters Reference" and publish it in

Re: [go-nuts] Type Parameters Proposal: constraint.Number should be replaced with constraints.Integer in the examples

2022-01-27 Thread Manlio Perillo
On Friday, January 21, 2022 at 11:25:13 PM UTC+1 Ian Lance Taylor wrote: > > Another issue is the implementation of AbsoluteDifference, in > golang.org/design/43651-type-parameters#absolute-difference. > > The code is invalid due to #45639, but I suspect that the suggestion to > use a struct

Re: [go-nuts] Type Parameters Proposal: constraint.Number should be replaced with constraints.Integer in the examples

2022-01-21 Thread Manlio Perillo
ary 20, 2022 at 8:46:19 PM UTC+1 Ian Lance Taylor wrote: > On Thu, Jan 20, 2022 at 2:28 AM Manlio Perillo > wrote: > > > > 1. In > golang.org/design/43651-type-parameters#constraints-apply-even-after-constraint-type-inference > , > > there is a typo i

Re: [go-nuts] Type Parameters Proposal: constraint.Number should be replaced with constraints.Integer in the examples

2022-01-20 Thread Manlio Perillo
I noted that in the design there are no examples of a generic function that use the range statement over array, slice, string or map. What is the reason? P.S: should I report these issues on the Github Issue or on golang-dev? Thanks Manlio On Thursday, January 20, 2022 at 9:12:31 AM UTC+1 Ma

Re: [go-nuts] Type Parameters Proposal: constraint.Number should be replaced with constraints.Integer in the examples

2022-01-20 Thread Manlio Perillo
in #48424. func DoubleDefined2(S ~[]E, E constraints.Integer) S { ... } Thanks Manlio On Wednesday, January 19, 2022 at 11:04:01 PM UTC+1 Ian Lance Taylor wrote: > On Wed, Jan 19, 2022 at 1:50 AM Manlio Perillo > wrote: > > > > I'm reading the Type Parameter Pro

Re: [go-nuts] Type Parameters Proposal: constraint.Number should be replaced with constraints.Integer in the examples

2022-01-19 Thread Manlio Perillo
: > On Wed, Jan 19, 2022 at 10:50 AM Manlio Perillo > wrote: > >> Hi. >> >> I'm reading the Type Parameter Proposal to learn how to use type >> parameters and I noted that one of the example in the "Element constraint >> example" section uses the &

[go-nuts] Type Parameters Proposal: constraint.Number should be replaced with constraints.Integer in the examples

2022-01-19 Thread Manlio Perillo
Hi. I'm reading the Type Parameter Proposal to learn how to use type parameters and I noted that one of the example in the "Element constraint example" section uses the constraints.Number constraint. This constraint does not exist and probably should be replaced with constraints.Integer. I

Re: [go-nuts] Re: Ignore /vendor by default in polyglot repository

2021-06-04 Thread Manlio Perillo
On Friday, June 4, 2021 at 6:24:28 PM UTC+2 Jacob Vosmaer wrote: > On Thu, Jun 3, 2021 at 6:35 PM Manlio Perillo > wrote: > > One possible solution is to have a GOENV file in the root directory of a > repository. > Thanks Manlio. Is that something that is possible

[go-nuts] Re: embedding files in tests

2021-06-03 Thread Manlio Perillo
Actually, if a file is embedded in the main package, go list will report it in the EmbedFiles field. If a file is embedded in a test, the -test flag is required because the test binary is required. Regards Manlio On Wednesday, June 2, 2021 at 5:56:42 PM UTC+2 peterGo wrote: > "it seems a bug

[go-nuts] Re: Ignore /vendor by default in polyglot repository

2021-06-03 Thread Manlio Perillo
On Thursday, June 3, 2021 at 6:04:21 PM UTC+2 Jacob Vosmaer wrote: > Hi, > > In our organization we have a main code repository that contains > components written in different programming languages. One of these > components is written in Go. I would like to be able to have a single > go.mod

[go-nuts] Re: embedding files in tests

2021-06-02 Thread Manlio Perillo
Here is an example: https://play.golang.org/p/ElnTtxHnF5I The output of `go list -json ./pkg` only reports `TestEmbedPatterns`. The output of `go list -json -test ./pkg` reports TestEmbedFiles for the pkg package (it seems a bug, since it should also be reported without the -test flag). The

[go-nuts] embedding files in tests

2021-06-01 Thread Manlio Perillo
When a file is embedded in a test file, will the file be embedded only in the test binary? The documentation says nothing about this case, but the data from go list seems to confirm that the file is only embedded in the test binary. Thanks Manlio -- You received this message because you are

[go-nuts] Re: Table-driven benchmarks defeat inlining

2021-06-01 Thread Manlio Perillo
On Tuesday, June 1, 2021 at 12:29:27 AM UTC+2 Paul S. R. Chisholm wrote: > This is not a serious problem, but it surprised me. (By the way, how can I > post a message with code formatting?) > > I'd like to create table-driven benchmarks: > https://blog.golang.org/subtests. > > To that end,

Re: [go-nuts] Json to CSV parsing with raw Data

2021-05-28 Thread Manlio Perillo
On Friday, May 28, 2021 at 6:26:46 PM UTC+2 sharathc...@gmail.com wrote: > QuoteToAscii converts non printable characters to \xd , but i literally > want the same value . > > QuoteToAscii will not produce the json compatible string or will not > escape string in true sense like > > Conversion

Re: [go-nuts] How to restore ignored signals

2021-05-24 Thread Manlio Perillo
On Sunday, May 23, 2021 at 12:29:47 AM UTC+2 Ian Lance Taylor wrote: > On Sat, May 22, 2021 at 5:53 AM Manlio Perillo > wrote: > > > > I'm curious to know if sigprocmask is safe/convenient to use in a Go > program. > > It's possible, of course, but it's

Re: [go-nuts] How to restore ignored signals

2021-05-22 Thread Manlio Perillo
On Friday, May 21, 2021 at 10:44:01 PM UTC+2 Ian Lance Taylor wrote: > On Fri, May 21, 2021 at 1:37 PM Manlio Perillo > wrote: > > > > [...] > > > > In https://play.golang.org/p/c88iu09mOgO, the SIGINT signal (via > Ctrl-C) is ignored after the call to `si

Re: [go-nuts] How to restore ignored signals

2021-05-22 Thread Manlio Perillo
On Friday, May 21, 2021 at 11:43:24 PM UTC+2 Ian Lance Taylor wrote: > On Fri, May 21, 2021 at 1:47 PM Brian Candler wrote: > > > > If I understand rightly, it boils down to this: > > https://play.golang.org/p/vYlTzluIuBL > > Thanks. That's clearly a bug. The sig.ignored mask is not being >

Re: [go-nuts] How to restore ignored signals

2021-05-21 Thread Manlio Perillo
On Friday, May 21, 2021 at 10:22:08 PM UTC+2 Ian Lance Taylor wrote: > On Fri, May 21, 2021 at 7:49 AM Manlio Perillo > wrote: > > > > In a program I want to read a password from the terminal, using > golang.org/x/term. > > The problem is that there is a possib

[go-nuts] How to restore ignored signals

2021-05-21 Thread Manlio Perillo
In a program I want to read a password from the terminal, using golang.org/x/term. The problem is that there is a possibility that a signal is sent to the program, resulting in the terminal state not being restored: https://play.golang.org/p/4IjLve9gDx0 In case of term.ReadPassword, on Linux I

Re: [go-nuts] Build error from pragma warnings when doing "go build -buildmode=c shared..."

2021-05-20 Thread Manlio Perillo
Note that you can explicitly tell go the C compiler to use, by setting the CC environment variable. As an example: go env -w CC=path-to-gcc4.9.4 Manlio On Thursday, May 20, 2021 at 4:05:22 PM UTC+2 slugge...@gmail.com wrote: > Removing gcc 4.1.2 from PATH so it picked up 4.9.4 which resolved

[go-nuts] Re: go.mod necessary for GitHub package?

2021-05-16 Thread Manlio Perillo
Sorry, I used an incorrect example. The final user is supposed to be in module mode and even if in GOPATH mode, the latest version is still compatible with the old version. On Sunday, May 16, 2021 at 4:04:38 PM UTC+2 Manlio Perillo wrote: > One example (not tested) is the case of a modul

[go-nuts] Re: go.mod necessary for GitHub package?

2021-05-16 Thread Manlio Perillo
One example (not tested) is the case of a module X that depends on A and B. A depends on an old version of github.com/speedata/hyphenation, and B depends on a new version (that is compatible with the old version but has a new API). In GOPATH mode, X can not be built. Manlio On Sunday, May 16,

[go-nuts] Re: go.mod necessary for GitHub package?

2021-05-16 Thread Manlio Perillo
The advantage of adding a go.mod file is not for you, but for people that will add your package as a dependency. Manlio On Sunday, May 16, 2021 at 8:25:23 AM UTC+2 Patrick wrote: > Hello all, > > I have a small package without any dependencies (besides standard library) > on GitHub. Just a

[go-nuts] Re: proposal: ignore stale information in go list -find -json

2021-05-12 Thread Manlio Perillo
I was suggesting to not use work.Builder in the go list command, even in case the -json flag is specified or the -f flag contains the ".Stale" string. I'm not sure about the -f flag, however, since it is an explicit request from the user. On the other hand, if the user specified the -find

[go-nuts] proposal: ignore stale information in go list -find -json

2021-05-12 Thread Manlio Perillo
The go list `-find` flag was introduced to skip resolving imports. However, is it really necessary to include stale information in this case? Does `golang.org/x/tools/go/package` need it? Getting stale information is not a trivial work, AFAIK. Is it ok to change the meaning of an existing flag?

[go-nuts] Re: Security issue in

2021-05-07 Thread Manlio Perillo
I think the problem here is not only the lack of a vulnerability database for go, but the fact that a lot of people use a module where only one person (the owner) has access to the repository. Maybe it is time for a new site like gopkg.in, where each module has one or more maintainer and there

Re: [go-nuts] How to do vdso calls in my own code?

2021-04-27 Thread Manlio Perillo
Il giorno martedì 27 aprile 2021 alle 00:40:17 UTC+2 Ian Lance Taylor ha scritto: > On Mon, Apr 26, 2021 at 1:24 AM Pure White wrote: > > [...] > > So I really want to know what is the right way to do vdso call outside > runtime? > > The right way is to use cgo. But probably the cost of

Re: [go-nuts] Re: How to do vdso calls in my own code?

2021-04-27 Thread Manlio Perillo
Il giorno martedì 27 aprile 2021 alle 17:51:46 UTC+2 Ian Lance Taylor ha scritto: > On Tue, Apr 27, 2021 at 7:43 AM Manlio Perillo > wrote: > > > > Il giorno lunedì 26 aprile 2021 alle 10:24:09 UTC+2 Pure White ha > scritto: > >> > >> So I really w

[go-nuts] Re: How to do vdso calls in my own code?

2021-04-27 Thread Manlio Perillo
Il giorno lunedì 26 aprile 2021 alle 10:24:09 UTC+2 Pure White ha scritto: > Hi all, > > I'm trying to get time using `CLOCK_REALTIME_COARSE` and > `CLOCK_MONOTONIC_COARSE` for performance reasons, and need to use vdso call > by hand-written assembly code. That is, I want to reimplement

[go-nuts] Re: A question about go bug template

2021-04-24 Thread Manlio Perillo
GOROOT is in fact set separately for ~/sdk/go1.12.17 (by the wrapper in GOBIN/go1.12.17), but in the end the go command used should be the same. Thanks. Il giorno sabato 24 aprile 2021 alle 13:22:03 UTC+2 seank...@gmail.com ha scritto: > 1 for consistency in the report template (helps

[go-nuts] A question about go bug template

2021-04-24 Thread Manlio Perillo
In the go bug template, go version is printed twice, the first time in the "go version" section and the second time in the "details" section as GOROOT/bin/go version. After https://golang.org/cl/288693 , these two entries should show the same version. In order for them to differ, one should

[go-nuts] Re: unable to install go1.1.2

2021-04-22 Thread Manlio Perillo
Il giorno giovedì 22 aprile 2021 alle 11:06:09 UTC+2 Manlio Perillo ha scritto: > I tried to install go1.1.2 on my system, without success. > > I encountered the following problems: > > 1. There is no binary release > 2. Compilation fails due to warnings: >

[go-nuts] Re: unable to install go1.1.2

2021-04-22 Thread Manlio Perillo
Il giorno giovedì 22 aprile 2021 alle 11:46:15 UTC+2 Manlio Perillo ha scritto: > [...] > About the gcc warnings, the _BSD_SOURCE and _SVID_SOURCE macros where > defined in include/u.h; after removing them I got 2 other warnings: > >- argument to 'sizeof' in 'strncpy' c

[go-nuts] Re: unable to install go1.1.2

2021-04-22 Thread Manlio Perillo
Il giorno giovedì 22 aprile 2021 alle 11:24:41 UTC+2 Brian Candler ha scritto: > Could you describe what platform you are trying to build on? > > Also, could you explain why you need to build such an ancient version? > There may be a better solution to whatever you're trying to do. > My

[go-nuts] unable to install go1.1.2

2021-04-22 Thread Manlio Perillo
I tried to install go1.1.2 on my system, without success. I encountered the following problems: 1. There is no binary release 2. Compilation fails due to warnings: warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE I solved by removing the `-Werror`

[go-nuts] Re: go build ./... will produce a binary of one and only one main package is found

2021-04-21 Thread Manlio Perillo
Il giorno mercoledì 21 aprile 2021 alle 09:07:23 UTC+2 Brian Candler ha scritto: > On Tuesday, 20 April 2021 at 20:28:56 UTC+1 manlio@gmail.com wrote: > >> And I notice only now that you can do `go build -o "" ./...`. >> > > But does that work? See >

[go-nuts] Re: go build ./... will produce a binary of one and only one main package is found

2021-04-20 Thread Manlio Perillo
Il giorno martedì 20 aprile 2021 alle 21:26:33 UTC+2 Manlio Perillo ha scritto: > Il giorno martedì 20 aprile 2021 alle 09:08:02 UTC+2 Brian Candler ha > scritto: > >> I agree with the OP: it would be less surprising if "go build ./..." >> always di

[go-nuts] Re: go build ./... will produce a binary of one and only one main package is found

2021-04-20 Thread Manlio Perillo
Il giorno martedì 20 aprile 2021 alle 09:08:02 UTC+2 Brian Candler ha scritto: > I agree with the OP: it would be less surprising if "go build ./..." > always did build and store the artefacts, and there were a separate flag to > discard them. > > Currently, "go build ./..." discards the build

[go-nuts] [ANN] go-portable and go-compatible

2021-04-20 Thread Manlio Perillo
vet on all the releases in ~/sdk. With the -since option, it is possible to limit the use to to only releases more recent than the specified version. With the -test option, the tool invokes go test, instead of go vet. Regards Manlio Perillo -- You received this message because you

[go-nuts] Re: go mod vendor, description, how?

2021-04-06 Thread Manlio Perillo
Il giorno martedì 6 aprile 2021 alle 09:47:18 UTC+2 Gergely Födémesi ha scritto: > Hi, > > assuming GO111MODULE=on. > I don't want to publish anything, anywhere. > > If you don't want to publish anything, you can use a reserved domain in your module path; as an example: gergely.localhost, or

[go-nuts] Re: [ANN] Interactive 2D graphics on an HTML canvas via WebSockets

2021-04-04 Thread Manlio Perillo
Il giorno domenica 4 aprile 2021 alle 10:32:36 UTC+2 Frederik Zipp ha scritto: > I often find myself wanting to visualize simple graphics or even > interactive animations from a Go program without resorting to > platform-dependent or Cgo-based libraries, so I created this Go module: > >

[go-nuts] Re: go list and GO111MODULE in Go 1.17

2021-04-01 Thread Manlio Perillo
Il giorno giovedì 1 aprile 2021 alle 18:58:33 UTC+2 dorianl...@gmail.com ha scritto: > Hi all, > > We have a monorepo with a bunch of services in it. > Currently, in Go 1.16, I'm able to build each service using "docker build > -" and generating the tar context "by hand" using something like:

[go-nuts] Re: io/fs adapters?

2021-03-28 Thread Manlio Perillo
For a project I wrote a simplified MapFS, where only the file data needs to be specified, as a string: https://gist.github.com/perillo/45dfe7eb1c87e2d436574cab0d11221c Manlio Il giorno domenica 28 marzo 2021 alle 10:06:21 UTC+2 seank...@gmail.com ha scritto: >

Re: [go-nuts] Trying to use a tool in my build (a friction log)

2021-03-20 Thread Manlio Perillo
Il giorno venerdì 19 marzo 2021 alle 23:20:49 UTC+1 Tim Hockin ha scritto: > Thanks for feedback, comments below > > On Thu, Mar 18, 2021 at 3:35 PM Jay Conrod wrote: > >> >> > [...] > > >> *2. "writing go.mod cache" error messages* >> >> This error message should be a lot better. Sorry

[go-nuts] Re: go mod to private repository using ssh

2021-02-18 Thread Manlio Perillo
Il giorno giovedì 18 febbraio 2021 alle 16:29:42 UTC+1 Rich ha scritto: > I've been avoiding the move to using go mod. Mainly because every time I > try it chokes on any of the internal repositories i have setup using ssh:// > g...@mycoderepo.com:7900 . I put

Re: [go-nuts] possible inconsistency in the embed package documentation

2021-01-23 Thread Manlio Perillo
mes beginning with .., so files in parent directories are also disallowed entirely, even when the parent directory named by .. does happen to be in the same module." Thinking about it, the parent package can export the embedded data variable, so it is probably not necessary for sub packag

Re: [go-nuts] possible inconsistency in the embed package documentation

2021-01-17 Thread Manlio Perillo
manlio@gmail.com > wrote: > >> https://golang.org/ref/mod#zip-path-size-constraints prevents >> directories that begin with a dot, but only because the directory is >> interpreted as a package. >> It is not clear, to me, if `.git` is ignored by the `embed` directive >

Re: [go-nuts] possible inconsistency in the embed package documentation

2021-01-16 Thread Manlio Perillo
with a dot. Thanks Manlio Perillo Il giorno sabato 16 gennaio 2021 alle 21:09:08 UTC+1 axel.wa...@googlemail.com ha scritto: > I think this is the best doc about what is included in a module: > https://golang.org/ref/mod#zip-path-size-constraints > Everything not in that list is

Re: [go-nuts] possible inconsistency in the embed package documentation

2021-01-16 Thread Manlio Perillo
As an example: is testdata outside the package's module? Thanks Manlio Il giorno sabato 16 gennaio 2021 alle 21:02:25 UTC+1 Manlio Perillo ha scritto: > Thanks. I was only considering the parent of the module's root directory. > Is the concept of "outside the module" d

Re: [go-nuts] possible inconsistency in the embed package documentation

2021-01-16 Thread Manlio Perillo
Thanks. I was only considering the parent of the module's root directory. Is the concept of "outside the module" defined somewhere? Manlio Perillo Il giorno sabato 16 gennaio 2021 alle 19:30:05 UTC+1 axel.wa...@googlemail.com ha scritto: > To put it another way: > >

[go-nuts] possible inconsistency in the embed package documentation

2021-01-16 Thread Manlio Perillo
t;Patterns must not contain ‘.’ or ‘..’ path elements nor begin with a leading slash" It seems to me that the first phrase is not necessary, since the second phrase prevents matching files outside the package module. Thanks Manlio Perillo -- You received this message because you are subs

Re: [go-nuts] [generics] question regarding package level generic type declarations

2020-07-21 Thread Manlio Perillo
What about: package example(T1, T2) This declares T1 and T2 as package level types. import "example"(int, float) This imports the example package with T1 as int and T2 as float. The limitation is that you need to import the same package multiple times for different T1 and T2.

[go-nuts] Re: SSL socket listener

2020-06-04 Thread Manlio Perillo
See https://golang.org/pkg/crypto/tls/#Conn about how to make a secure network connection. There is an example for the Dial function. For the normal network API see https://golang.org/pkg/net/ Manlio Il giorno mercoledì 3 giugno 2020 alle 09:20:12 UTC+2 Wesley Peng ha scritto: > Hello, > >

[go-nuts] Memory leak in github.com/golang/freetype

2020-05-13 Thread Manlio Perillo
The following program using the freetype package leaks memory: https://play.golang.org/p/I90PYZUngVu The first two cycles have no problems but starting with the third cycle there is in an abnormal increase of CPU and memory usage. At the fourth cycle on my system the program is terminated by the

[go-nuts] Re: flags package: shared flags and flag sets

2020-05-07 Thread Manlio Perillo
On Wednesday, May 6, 2020 at 2:08:25 PM UTC+2, Chris Burkert wrote: > > Dear all, > > I'd like to mix shared flags with flags specific to flag sets (cooltool > ). However I struggle to parse the > shared flags only and pass the rest to the flagset for parsing. Here is > what I came up with: >

[go-nuts] Re: marshal multiple json documents which may have different format versions into the latest struct version

2020-04-28 Thread Manlio Perillo
On Tuesday, April 28, 2020 at 10:52:56 AM UTC+2, Chris Burkert wrote: > > Dear all, > > my application users shall be able to provide multiple json documents > (files and urls) which I'd like to marshall into one structure. > Additionally these json documents may have different versions. I know

[go-nuts] Re: Packet parsing in Go

2020-04-21 Thread Manlio Perillo
On Tuesday, April 21, 2020 at 6:08:22 PM UTC+2, Rakesh K R wrote: > > Hi, > I am new to Go and I am trying to parse the network packets received. > In C, we used to typecast this array of uint8_t to predefined structure. > Is there a way I can do this similarly in Go? or any better approach to do

[go-nuts] Re: deadlock with a empty select{} in main goroutine.

2020-04-08 Thread Manlio Perillo
On Wednesday, April 8, 2020 at 6:17:59 PM UTC+2, aravind...@gmail.com wrote: > > > Hi All, > > I am not able to understand why this piece of go code deadlocks. > Doesn't empty select{} blocks forever, irrespective of other go routines > to wake that up. > > https://play.golang.org/p/zBWZPjTGYX7

Re: [go-nuts] Re: Go 1.14.1 and Go 1.13.9 are released

2020-03-19 Thread Manlio Perillo
r to read. > > Also see https://golang.org/doc/faq#go_or_golang. While the language is > called "Go", the term "golang" still comes up occasionally in some contexts. > > > On Thursday, March 19, 2020 at 5:12:41 PM UTC-4, Ian Lance Taylor wrote: >> >&g

[go-nuts] Re: Go 1.14.1 and Go 1.13.9 are released

2020-03-19 Thread Manlio Perillo
Thanks for the release. However I'm a bit sad that even the Go team is starting to use "golang" instead of "go": https://github.com/golang/go/issues/37613 golang 1.14.rc1 3-5% performance regression from golang 1.13 during protobuf marshalling Now I see golang instead of go on blog articles,

Re: [go-nuts] Changing source code in order code to be supported from older Golang versions e.g. Go 1.10

2020-03-07 Thread Manlio Perillo
Python has a similar policy about Windows support: https://docs.python.org/dev/using/windows.html#supported-versions The same for Rust: https://forge.rust-lang.org/release/platform-support.html Manlio On Saturday, March 7, 2020 at 2:43:50 PM UTC+1, Amnon Baron Cohen wrote: > > also > > >

[go-nuts] Re: How to handle EINTR from syscall.Dup2

2020-02-29 Thread Manlio Perillo
On Friday, February 28, 2020 at 9:41:39 PM UTC+1, pboam...@gmail.com wrote: > > (I've asked the same question already, but probably in the wrong thread, > sorry for the repost.) > > What to do on EINTR from syscall.Dup2 (Linux)? > > 1) It never happen. > 2) Retry. > 3) Take it as irrecoverable. >

Re: [go-nuts] Re: Lot's of test errors in package zmq4 with Go version 1.14, no errors with earlier versions

2020-02-28 Thread Manlio Perillo
On Friday, February 28, 2020 at 6:29:56 PM UTC+1, Ian Lance Taylor wrote: > > On Fri, Feb 28, 2020 at 9:14 AM Manlio Perillo > wrote: > > > > On Friday, February 28, 2020 at 5:36:09 PM UTC+1, Ian Lance Taylor > wrote: > >> > >> On Fri, Feb 28

Re: [go-nuts] Re: Lot's of test errors in package zmq4 with Go version 1.14, no errors with earlier versions

2020-02-28 Thread Manlio Perillo
On Friday, February 28, 2020 at 5:36:09 PM UTC+1, Ian Lance Taylor wrote: > > On Fri, Feb 28, 2020 at 8:27 AM Manlio Perillo > wrote: > > > > On Friday, February 28, 2020 at 4:57:00 PM UTC+1, Ian Lance Taylor > wrote: > >> > >> On Fri, Feb 2

Re: [go-nuts] Re: Lot's of test errors in package zmq4 with Go version 1.14, no errors with earlier versions

2020-02-28 Thread Manlio Perillo
On Friday, February 28, 2020 at 4:57:00 PM UTC+1, Ian Lance Taylor wrote: > > On Fri, Feb 28, 2020 at 7:18 AM Peter Kleiweg > wrote: > > > > Op vrijdag 28 februari 2020 16:13:50 UTC+1 schreef Robert Engels: > >> > >> > >> Can you clarify that a bit? Did you change the code to look for EINTR

Re: [go-nuts] Re: Lot's of test errors in package zmq4 with Go version 1.14, no errors with earlier versions

2020-02-27 Thread Manlio Perillo
On Thursday, February 27, 2020 at 2:15:14 AM UTC+1, Ian Lance Taylor wrote: > > On Wed, Feb 26, 2020 at 9:11 AM Manlio Perillo > wrote: > > > > On Wednesday, February 26, 2020 at 4:14:38 PM UTC+1, Ian Lance Taylor > wrote: > >> > >> On Wed, Feb 26

[go-nuts] Re: Modules and cross-compilation

2020-02-26 Thread Manlio Perillo
On Wednesday, February 26, 2020 at 8:53:52 PM UTC+1, geoff.j...@gmail.com wrote: > > Hello. > > > > [...] > > > > So: > >1. > >I don’t understand why go build foo.com/foobar fails to find the >module if it doesn’t contain some top-level .go file, but go list -m >finds it

Re: [go-nuts] Re: Lot's of test errors in package zmq4 with Go version 1.14, no errors with earlier versions

2020-02-26 Thread Manlio Perillo
On Wednesday, February 26, 2020 at 4:14:38 PM UTC+1, Ian Lance Taylor wrote: > > On Wed, Feb 26, 2020 at 7:11 AM Manlio Perillo > wrote: > > > > On Wednesday, February 26, 2020 at 3:51:54 PM UTC+1, Peter Kleiweg > wrote: > >> > >> Op woensdag 26 f

[go-nuts] Re: Lot's of test errors in package zmq4 with Go version 1.14, no errors with earlier versions

2020-02-26 Thread Manlio Perillo
On Wednesday, February 26, 2020 at 3:51:54 PM UTC+1, Peter Kleiweg wrote: > > Op woensdag 26 februari 2020 13:05:40 UTC+1 schreef Manlio Perillo: >> >> On Wednesday, February 26, 2020 at 12:33:05 PM UTC+1, Peter Kleiweg wrote: >>> >>> With Go version 1

[go-nuts] Re: Lot's of test errors in package zmq4 with Go version 1.14, no errors with earlier versions

2020-02-26 Thread Manlio Perillo
On Wednesday, February 26, 2020 at 12:33:05 PM UTC+1, Peter Kleiweg wrote: > > With Go version 1.14 I get a lot of errors when I run: > > go test -v github.com/pebbe/zmq4 > > I didn't see this with Go 1.13.8 or any earlier version. > > Is this a problem with Go 1.14, or am I doing something

Re: [go-nuts] Fuchsia Programming Language Policy

2020-02-25 Thread Manlio Perillo
And the one that is good at both memory management and concurrency has properties of the language that are not yet well-understood. Manlio On Tuesday, February 25, 2020 at 7:21:00 PM UTC+1, Michael Jones wrote: > > Actually, you should read the whole note -- it's fun. Half of the > languages

Re: [go-nuts] [security] Vulnerability in golang.org/x/crypto/ssh

2020-02-22 Thread Manlio Perillo
On Saturday, February 22, 2020 at 9:36:30 AM UTC+1, Jakob Borg wrote: > > On 20 Feb 2020, at 19:40, Filippo Valsorda > wrote: > > > Version v0.0.0-20200220183623-bac4c82f6975 of golang.org/x/crypto fixes a > vulnerability > > > Am I the only one to think that this kind of versioning is not ideal

Re: [go-nuts] Re: [Proposal] Change how gofmt formats struct fields

2020-02-20 Thread Manlio Perillo
On Thursday, February 20, 2020 at 3:52:40 PM UTC+1, ohir wrote: > > Dnia 2020-02-20, o godz. 08:57:51 > David Riley > napisał(a): > > > I'm willing to be convinced otherwise. [...] > > a new "magic" tab that won't be supported > > This proposal is not about some "magic tab". It is about a

Re: [go-nuts] Re: [Proposal] Change how gofmt formats struct fields

2020-02-20 Thread Manlio Perillo
On Thursday, February 20, 2020 at 12:01:57 PM UTC+1, Amnon Baron Cohen wrote: > > Gofmt's style is no one's favorite, yet gofmt is everyone's favorite. >> > > > From Go Proverbs. > > https://www.youtube.com/watch?v=PAAkCSZUG1c=8m43s > > Rob

Re: [go-nuts] Re: [Proposal] Change how gofmt formats struct fields

2020-02-19 Thread Manlio Perillo
On Wednesday, February 19, 2020 at 7:26:32 PM UTC+1, ohir wrote: > > Dnia 2020-02-18, o godz. 10:16:57 > Manlio Perillo > napisał(a): > > > Here is an example of a diff with a lot of noise, where the actual > change > > is very hard to see: >

[go-nuts] Re: [Proposal] Change how gofmt formats struct fields

2020-02-18 Thread Manlio Perillo
On Wednesday, January 29, 2020 at 6:56:35 PM UTC+1, Manlio Perillo wrote: > > This is a proposal for the next version Go. > > Currently gofmt formats struct fields to make the field name and type > aligned. > However this may cause extra changes in a commit diff when one

Re: [go-nuts] Why Discord is switching from Go to Rust

2020-02-07 Thread Manlio Perillo
On Friday, February 7, 2020 at 5:13:45 PM UTC+1, Lutz Horn wrote: > > > "Remarkably, we had only put very basic thought into optimization as the > Rust version was written. Even with just basic optimization, Rust was able > to outperform the hyper hand-tuned Go version. This is a huge testament

[go-nuts] Re: Go 1.14 Release Candidate 1 is released

2020-02-05 Thread Manlio Perillo
Is there some overhead due to preemption? About EINTR, I suspect that some programs will have problems. As an example https://github.com/golang/go/issues/22838 The issue was reported for MacOS, but technically every signal, including SIGSTOP, can interrupt a syscall. Thanks Manlio On

  1   2   3   >