Re: [go-nuts] Re: Should dev tools be tracked by go.mod?

2022-01-24 Thread Kevin Wan
I'm separating go.mod files for framework and cli tool in our project . It works well. On Tuesday, January 25, 2022 at 5:45:29 AM UTC+8 sv...@redhat.com wrote: > Hi Sean, > > Thanks a lot for your answer! > > On Mon, Jan 24, 2022 at 9:01 PM Sean Liao wrote:

Re: [go-nuts] Various questions about posts from The Go Blog

2022-01-24 Thread Ian Lance Taylor
On Mon, Jan 24, 2022 at 6:38 AM Kamil Ziemian wrote:, > > I have one more think to say about Go blog post "Why generics?". Again, > nothing really important. > > In the section "Generic data structures" in the second counting from the end > code example we have line. > > *pn = &node(E){val: v} >

Re: [go-nuts] Implement generic type interface

2022-01-24 Thread Ian Lance Taylor
On Mon, Jan 24, 2022 at 9:02 AM 'Kaisa Lim' via golang-nuts < golang-nuts@googlegroups.com> wrote: > Before the question, I'm sorry I'm not good at English > > when go 1.18 beta released, i try to test generic type > Most of the code worked, but something went wrong when implementing the > generic

Re: [go-nuts] Re: Should dev tools be tracked by go.mod?

2022-01-24 Thread Sven Anderson
Hi Sean, Thanks a lot for your answer! On Mon, Jan 24, 2022 at 9:01 PM Sean Liao wrote: > As a (hypothetical) consumer of your library, I would definitely > appreciate fewer dependencies, > mostly to reduce the chance of (or difficulty of resolving) conflicts with > any other dependencies I may

[go-nuts] Re: Should dev tools be tracked by go.mod?

2022-01-24 Thread Sean Liao
As a (hypothetical) consumer of your library, I would definitely appreciate fewer dependencies, mostly to reduce the chance of (or difficulty of resolving) conflicts with any other dependencies I may have (especially painful when incompatible v0.X.Y transitive dependencies are used). It seems

[go-nuts] Should dev tools be tracked by go.mod?

2022-01-24 Thread Sven Anderson
Hi everyone, In our project we are having a dispute on a very similar topic as the one raised by Rodolfo Carvalho recently , and input from this forum might help us to settle it. The

Re: [go-nuts] Implement generic type interface

2022-01-24 Thread 'Axel Wagner' via golang-nuts
It seems you might want to read the actual error message it shows. And perhaps contact the vendor of that IDE (you didn't say which one). On Mon, Jan 24, 2022 at 6:02 PM 'Kaisa Lim' via golang-nuts < golang-nuts@googlegroups.com> wrote: > Before the question, I'm sorry I'm not good at English > >

[go-nuts] Implement generic type interface

2022-01-24 Thread 'Kaisa Lim' via golang-nuts
Before the question, I'm sorry I'm not good at English when go 1.18 beta released, i try to test generic type Most of the code worked, but something went wrong when implementing the generic interface. This is my code > type Repository[T any] interface { Save(T) T } type repo[T any] struct

[go-nuts] Re: WIKI: Assert Libraries for Testing

2022-01-24 Thread Rheza
Go author has their own ideal. Writing Go should be simple without too much 3rd party lib that can make mini-language inside Go language. It's up to you if you want to adopt. But the Wiki https://github.com/golang/go/wiki/TestComments is a good place to consider how you write better code and

Re: [go-nuts] Re: Drawing millions of images on a bigger canvas

2022-01-24 Thread Robert Engels
Many image formats support tiling so you don’t need to have the entire image in memory (since a very large image is usually scaled or only a portion used at a time). > On Jan 24, 2022, at 10:07 AM, Howard C. Shaw III > wrote: > >  > One more options to add to Tamás' suggestions - due to Go

[go-nuts] Re: Drawing millions of images on a bigger canvas

2022-01-24 Thread Howard C. Shaw III
One more options to add to Tamás' suggestions - due to Go's interface design, implementing a draw.Image, which is an image.Image with an additional Set(x, y int, c color.Color) method, is sufficient to use draw.Draw for compositing. As such, you can pre-allocate a flat-file with sufficient spa

[go-nuts] pprof (profile.proto) symbols ambiguity

2022-01-24 Thread Iskander Sharipov
Imagine that we have these two cases: 1. A function `f` with one anonymous function inside 2. A type `f` with method `func1` (f is a by-value receiver) This will result in both entries to be identical in the generated profile. > pkg.f.func1 -- refers to anonymous function (1) > pkg.f.func1 -- re

Re: [go-nuts] Various questions about posts from The Go Blog

2022-01-24 Thread Kamil Ziemian
Hello, I have one more think to say about Go blog post "Why generics?". Again, nothing really important. In the section "Generic data structures" in the second counting from the end code example we have line. > *pn = &node(E){val: v} It is commented by the sentence "Notice the type argument E t

Re: [go-nuts] Various questions about posts from The Go Blog

2022-01-24 Thread Kamil Ziemian
Hello, Since with release of Go 1.18 we will have Go's generics, I started a preparation tour around Go blog and YouTube. And here is one suggestion and one unimportant comment of mine about blog post "Why Generics?" (https://go.dev/blog/why-generics). This post is in my opinion very valuable,

[go-nuts] scripting in Go

2022-01-24 Thread eko...@gmail.com
sc is a convenience package to support writing short automation scripts that simply panic on errors. It is similar to shell scripting with "set -e" option. https://pkg.go.dev/github.com/egonk/sc I wrote the package to stop copy pasting trivial helpers in throwaway and build automation scripts.