[go-nuts] Go Boring release schedule

2021-08-27 Thread Jonathan Yu
Hey there,

Go 1.17 was released last week (Aug 16th), but it appears the corresponding
build of Go + Boring Crypto is not available yet (checking the Google Cloud
Storage bucket as well as Docker Hub). Does anyone know if these releases
typically track the main upstream Go closely, or if releases lag some
period of time?

I understand some folks might be on summer vacation, so wanted to check if
there's an expected publication date for this so I can plan accordingly. :)

Thanks,

Jonathan

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAMDxSEg4rKBv2DJRHsWPRT5DPLaY672rZzU%2BPBnVnR_ZdFW9LQ%40mail.gmail.com.


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

2021-08-27 Thread Connor Kuehl
Oops, I see another reply to this thread linked to a document that has a better 
description of what I stumbled through. :-)

Connor

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/DBE575B8-F3B3-47CC-93D2-65D2F2BC9187%40gmail.com.


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

2021-08-27 Thread Connor Kuehl



> On Aug 26, 2021, at 5:21 PM, 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 demonstrates the bug, fix 
> the bug, and submit a patch to the maintainer.
> 
> After making the fix but before submitting the patch, I'd like to first 
> import my local copy of the quote package to ensure my change prevents the 
> problem in my application. How could I do that?

I recently did something like this:

1. Fork the repository
2. Clone it, fix it up
3. Push your changes to your fork
4. Then, in your project: 

go mod edit -replace 
github.com/upstream_org/repo=github.com/your_user/repo@branch

The thing I don’t like about this approach is having to push to the remote each 
time I want to iterate. 

However, after writing this all out, I recently did a quick experiment to see 
if I could just operate on a local copy and it seems to have worked!

1. Clone the repository
2. Fix it up locally
3. Then, in your project:

go mod edit -replace 
GitHub.com/upstream_org/repo=/path/to/your/clone/of/the/patched-project

Connor

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/E67B8233-D81A-43B5-9FE3-4A2193BE738B%40gmail.com.


Re: [go-nuts] write func with optional bool return value

2021-08-27 Thread Vasiliy Tolstov
Ok, thank you for the clarification

пт, 27 авг. 2021 г. в 18:18, Axel Wagner :
>
> No, it is not possible. The *only* functions that can return either one or 
> two returns are builtins.
> That's because the number of returns is part of the type of a function, so it 
> is constant for every function.
> Builtin "functions", OTOH, are not really functions, in terms of the 
> language. They are intrinsics of the compiler, which parses the 
> call-expression and translates them into machine code or calls into the 
> runtime (which is also how they can be generic, without Go having generics). 
> You can see that by trying to assign a builtin function to a variable: 
> https://play.golang.org/p/0EiSIIqSLhp
> This would be possible for every function - but `append` has no type, so you 
> can't put it in a variable (which would need to have the same type as 
> `append`).
>
> What you ask is just categorically impossible in Go.
>
> On Fri, Aug 27, 2021 at 5:06 PM Vasiliy Tolstov  wrote:
>>
>> I know, so my question is - does it possible to write such functions
>> like builtin? For example I can create func via reflect
>>
>> пт, 27 авг. 2021 г. в 18:03, Levieux Michel :
>> >
>> > Hi,
>> >
>> > Optional returns and parameters don't exist in go, what you are referring 
>> > to is built-in behavior specific to some features.
>> >
>> > A good way to approach what you want is by assigning it to the anonymous 
>> > '_' var when you don't want the returned bool.
>> >
>> > Hope this helps
>> >
>> > Le ven. 27 août 2021 à 16:58, Vasiliy Tolstov  a 
>> > écrit :
>> >>
>> >> Does it possible to have own func that have string, bool return value,
>> >> but bool value optional?
>> >> Like receiving from channel or get element from map, or like when
>> >> casting to some type interface?
>> >>
>> >> --
>> >> Vasiliy Tolstov,
>> >> e-mail: v.tols...@selfip.ru
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google Groups 
>> >> "golang-nuts" group.
>> >> To unsubscribe from this group and stop receiving emails from it, send an 
>> >> email to golang-nuts+unsubscr...@googlegroups.com.
>> >> To view this discussion on the web visit 
>> >> https://groups.google.com/d/msgid/golang-nuts/CACaajQvoPEGMM-KB3uRmibXr_HL_aqz_bb2%3DKT%3DsbQKR4U4Gkw%40mail.gmail.com.
>>
>>
>>
>> --
>> Vasiliy Tolstov,
>> e-mail: v.tols...@selfip.ru
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to golang-nuts+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/CACaajQsJ3KeKMStEWvUYtgGnmZMX1gbq_vbt73k6TM2LTkepUA%40mail.gmail.com.



-- 
Vasiliy Tolstov,
e-mail: v.tols...@selfip.ru

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CACaajQuMuB0Xip2TCmrrMHt-jPbNsrSYd3ngS0cfTXRWfiK_Nw%40mail.gmail.com.


Re: [go-nuts] write func with optional bool return value

2021-08-27 Thread 'Axel Wagner' via golang-nuts
No, it is not possible. The *only* functions that can return either one or
two returns are builtins.
That's because the number of returns is part of the type of a function, so
it is constant for every function.
Builtin "functions", OTOH, are not really functions, in terms of the
language. They are intrinsics of the compiler, which parses the
call-expression and translates them into machine code or calls into the
runtime (which is also how they can be generic, without Go having
generics). You can see that by trying to assign a builtin function to a
variable: https://play.golang.org/p/0EiSIIqSLhp
This would be possible for every function - but `append` has no type, so
you can't put it in a variable (which would need to have the same type as
`append`).

What you ask is just categorically impossible in Go.

On Fri, Aug 27, 2021 at 5:06 PM Vasiliy Tolstov  wrote:

> I know, so my question is - does it possible to write such functions
> like builtin? For example I can create func via reflect
>
> пт, 27 авг. 2021 г. в 18:03, Levieux Michel :
> >
> > Hi,
> >
> > Optional returns and parameters don't exist in go, what you are
> referring to is built-in behavior specific to some features.
> >
> > A good way to approach what you want is by assigning it to the anonymous
> '_' var when you don't want the returned bool.
> >
> > Hope this helps
> >
> > Le ven. 27 août 2021 à 16:58, Vasiliy Tolstov  a
> écrit :
> >>
> >> Does it possible to have own func that have string, bool return value,
> >> but bool value optional?
> >> Like receiving from channel or get element from map, or like when
> >> casting to some type interface?
> >>
> >> --
> >> Vasiliy Tolstov,
> >> e-mail: v.tols...@selfip.ru
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups "golang-nuts" group.
> >> To unsubscribe from this group and stop receiving emails from it, send
> an email to golang-nuts+unsubscr...@googlegroups.com.
> >> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/CACaajQvoPEGMM-KB3uRmibXr_HL_aqz_bb2%3DKT%3DsbQKR4U4Gkw%40mail.gmail.com
> .
>
>
>
> --
> Vasiliy Tolstov,
> e-mail: v.tols...@selfip.ru
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/CACaajQsJ3KeKMStEWvUYtgGnmZMX1gbq_vbt73k6TM2LTkepUA%40mail.gmail.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAEkBMfGjdCgLi1L9-SJP2kn%2BixugZ5NSpprerhEXSLqeS%3DXjxA%40mail.gmail.com.


Re: [go-nuts] write func with optional bool return value

2021-08-27 Thread Vasiliy Tolstov
I know, so my question is - does it possible to write such functions
like builtin? For example I can create func via reflect

пт, 27 авг. 2021 г. в 18:03, Levieux Michel :
>
> Hi,
>
> Optional returns and parameters don't exist in go, what you are referring to 
> is built-in behavior specific to some features.
>
> A good way to approach what you want is by assigning it to the anonymous '_' 
> var when you don't want the returned bool.
>
> Hope this helps
>
> Le ven. 27 août 2021 à 16:58, Vasiliy Tolstov  a écrit :
>>
>> Does it possible to have own func that have string, bool return value,
>> but bool value optional?
>> Like receiving from channel or get element from map, or like when
>> casting to some type interface?
>>
>> --
>> Vasiliy Tolstov,
>> e-mail: v.tols...@selfip.ru
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to golang-nuts+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/CACaajQvoPEGMM-KB3uRmibXr_HL_aqz_bb2%3DKT%3DsbQKR4U4Gkw%40mail.gmail.com.



-- 
Vasiliy Tolstov,
e-mail: v.tols...@selfip.ru

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CACaajQsJ3KeKMStEWvUYtgGnmZMX1gbq_vbt73k6TM2LTkepUA%40mail.gmail.com.


Re: [go-nuts] write func with optional bool return value

2021-08-27 Thread Levieux Michel
Hi,

Optional returns and parameters don't exist in go, what you are referring
to is built-in behavior specific to some features.

A good way to approach what you want is by assigning it to the anonymous
'_' var when you don't want the returned bool.

Hope this helps

Le ven. 27 août 2021 à 16:58, Vasiliy Tolstov  a
écrit :

> Does it possible to have own func that have string, bool return value,
> but bool value optional?
> Like receiving from channel or get element from map, or like when
> casting to some type interface?
>
> --
> Vasiliy Tolstov,
> e-mail: v.tols...@selfip.ru
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/CACaajQvoPEGMM-KB3uRmibXr_HL_aqz_bb2%3DKT%3DsbQKR4U4Gkw%40mail.gmail.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAL4P9zxQQKHq-CTROXVpmnfGw1vLs9Uy1C%3Duc5o3bFvn%3DBGbig%40mail.gmail.com.


[go-nuts] write func with optional bool return value

2021-08-27 Thread Vasiliy Tolstov
Does it possible to have own func that have string, bool return value,
but bool value optional?
Like receiving from channel or get element from map, or like when
casting to some type interface?

-- 
Vasiliy Tolstov,
e-mail: v.tols...@selfip.ru

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CACaajQvoPEGMM-KB3uRmibXr_HL_aqz_bb2%3DKT%3DsbQKR4U4Gkw%40mail.gmail.com.


[go-nuts] fonts, bitmap and the (old TeX) PK file format

2021-08-27 Thread 'Sebastien Binet' via golang-nuts
hi there,

I am working on providing a pure-Go TeX engine.
to achieve such a thing, I'd need to be able to decode and use the
so-called "PacKed font file" format (PK fonts).
(I know it's a very old & deprecated file format, but I figured it would
be easier on me to start "old tech" first)

I think I managed to properly decode it, and managed to extract the
bitmap data of each glyph:

- https://play.golang.org/p/dA8cev_x4TQ

the program above displays the bitmap data extracted for glyph 'a':

$> go run ./main.go
  ......
  **
  ..*...**..
  .****.
  ***...
  ...*****..
  ......**..
  ...**.
  ...**.
  ....**
  **..**
  ....**
  **
  **
  **
  **
  .*
  .*
  ..*.**
  ***.**
  ..***...**
  **
  ...***..**
  ....**
  ....**
  .*****
  .*****..**
  ***.**..**
  ***.**..**
  ***.**..**
  ******..**
  ******..**
  ....**
  .***.***.*..**
  .**...***.
  ......***.
  ***....*..
  ..*****...
  .*

now, the question is: how should I packaged that data so that I can
interoperate best with, say, golang.org/x/image/font ?

would I just use a golang.org/x/image/font/basicfont.Face ?

cheers,
-s

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CDUBWL1U9FSV.3DN7WB3DOZFFD%40zoidberg.


[go-nuts] Re: 'go vet' not finding methods exported in _test.go files?

2021-08-27 Thread Sean Liao
I can't reproduce the error you're seeing either in 1.15 or in later 
versions with the code you provided

On Friday, August 27, 2021 at 10:11:07 AM UTC+2 wji...@gmail.com wrote:

> Hi,
>
> We've recently moved from using 'go tool vet' to 'go vet' (we need to 
> stick to the Go versions shipped with Debian) and have found that it is not 
> finding public methods that we export for test only by putting them in 
> _test.go files (error is 'undeclared name'). Disable go vet, and you can 
> build and run the test code fine. Problematic code is something like this:
>
> export_for_test.go:
>
> package foo
>
> func ExportedForTest() {
> // Do something
> }
>
> ---
>
> foo_test.go
>
> package foo_test
>
> import (
> "foo"
> "testing"
> )
>
> func TestFoo(t *testing.T) {
> foo.ExportedForTest()
> }
>
> ---
>
> We are using Go 1.15 in Debian 10.
>
> This would appear to be a bug in 'go vet' given the actual build and 
> running of test code works fine. Is there any way to work around this, and 
> has it been fixed in more recent releases (not that this would solve our 
> problem as we are stuck with the buster-backport version of Go for now, and 
> Debian 11 is also using Go 1.15).
>
> Thanks,
>
> William
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/a141f3af-9eac-44a8-aa8e-4613c7eb0a1dn%40googlegroups.com.


[go-nuts] 'go vet' not finding methods exported in _test.go files?

2021-08-27 Thread William Ivory
Hi,

We've recently moved from using 'go tool vet' to 'go vet' (we need to
stick to the Go versions shipped with Debian) and have found that it is
not finding public methods that we export for test only by putting them
in _test.go files (error is 'undeclared name'). Disable go vet, and you
can build and run the test code fine. Problematic code is something
like this:

export_for_test.go:

package foo

func ExportedForTest() {
// Do something
}

---

foo_test.go

package foo_test

import (
"foo"
"testing"
)

func TestFoo(t *testing.T) {
foo.ExportedForTest()
}

---

We are using Go 1.15 in Debian 10.

This would appear to be a bug in 'go vet' given the actual build and
running of test code works fine. Is there any way to work around this,
and has it been fixed in more recent releases (not that this would
solve our problem as we are stuck with the buster-backport version of
Go for now, and Debian 11 is also using Go 1.15).

Thanks,

William



-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/e2b64e01a62b296eea9bfc9ea7f141b264944222.camel%40gmail.com.