Re: [go-nuts] Re: behavior of %f

2022-10-11 Thread Marvin Renich
* Dante Castagnoli  [221010 18:01]:
> Thanks!
> 
> It's not lost, though.  It shows up with the %g form.
> 
> Knowing about %g, my issue is not extant, but others might hit it.  I'm 
> relatively new to floating point issues, and I saw numbers showing up as 
> integers, and it took a while to sort out what was going on, is all.
> 
> As the behavior matches "c", I would suggest at minimum making the 
> documentation clearer.
> 
> https://go.dev/play/p/WBlf3jltimr

Your comparison is flawed.  Take your original playground code (the one
with just %0.3f) and change the "f" to "g" without removing the "0.3"
and run it again.  You will see the same rounding behavior as with "f".

The documentation says:

  The default precision ... for %g ... is the smallest number of digits
  necessary to identify the value uniquely.

So without explicitly specifying the precision, %g will print as many
digits as necessary (i.e. enough precision is used to prevent rounding).

What representation, using only the precision specified, most closely
represents the value being formatted?  That is how you should think of
the floating point formatting behavior, rather than thinking of it as
rounding.

...Marvin

-- 
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/Y0VX94m6RoYs5X8i%40basil.wdw.


[go-nuts] Re: Is it possible and how to connect to USB devices from Android in a Go program?

2022-10-11 Thread Marko Bencun
Hi

In Go, define an interface for opening the device and writing to it.

Implement that interface in Java/Kotlin using the Android API for 
interfacing with USB.

I used this without any issues in the BitBoxApp, which is an Android App 
that communicates with the BitBox02 hardware wallet:

Go interface:

https://github.com/digitalbitbox/bitbox-wallet-app/blob/1e1e2c6a4cfb0760eae472e759b0974d114fbdea/backend/devices/usb/manager.go#L47-L57

Java implementation:

https://github.com/digitalbitbox/bitbox-wallet-app/blob/1e1e2c6a4cfb0760eae472e759b0974d114fbdea/frontends/android/BitBoxApp/app/src/main/java/ch/shiftcrypto/bitboxapp/GoViewModel.java#L30

Cheers
On Friday, July 9, 2021 at 11:17:15 PM UTC+2 Óscar Giménez wrote:

> Hi,
>
> Were you able to solve this issue?
> I'm facing the same problem.
> Any help would be appreciated.
>
> Thanks
>
> On Sunday, August 21, 2016 at 1:32:48 AM UTC+2 con...@theninjabunny.com 
> wrote:
>
>>
>> I'm developing an Android app using Golang that make use of a USB device 
>> connected to the Android (on those that support the host mode). My app 
>> works great if the device is rooted and SELinux is in permissive, 
>> unfortunately that's not common at all.
>>
>> To avoid that, you could open the USB device in Java (usbManager) and 
>> then pass the file descriptor to the NDK (Go) code. At this point, I'm not 
>> sure if it's possible at all, or the x/mobile code has to be modified, but 
>> I have no idea how to continue nor where to find more information on the 
>> topic.
>>
>> Using gomobile/bind for the app
>>
>

-- 
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/612de7dc-6254-4228-b171-4baeb7991c2bn%40googlegroups.com.


[go-nuts] How to call sort.Search in a loop

2022-10-11 Thread 'ljh' via golang-nuts
Hi community,


I used sort.Search on a sorted slice in below code started at Line 36, and it 
worked.


I also tried to call sort.Search in a loop, started at Line 53. It does not 
seem to work. How can I correct the loop version?


Thanks


---


package main


import (
"log"
"sort"
)


type T struct {
name string
}


func main() {
log.SetFlags(log.LstdFlags | log.Llongfile)


haystack := []T{
// {name: "apple",  },
{name: "compote", }, //dup
{name: "orange", },
{name: "compote", }, //dup
}


sort.Slice(haystack, func(i, j int) bool {
if haystack[i].name < haystack[j].name {
return true
} else {
return false
}
})


for _, t := range haystack {
log.Println("sorted", t)
}


needle := T{name: "compote"}


// Style 1: ok, lower upper bounds style// Line 36
/*
lower := sort.Search(len(haystack), func(i int) bool {
return haystack[i].name == needle.name
})


upper := sort.Search(len(haystack), func(i int) bool {
return haystack[i].name > needle.name
})


if lower != len(haystack) {
for i := lower; i != upper; i++ {
log.Println("found", i, haystack[i])
}
}
*/


// Style 2: error, loop style   // Line 
53
for index := 0; index < len(haystack); index++ {
ret := sort.Search(len(haystack[index:]), func(i int) bool 
{ 
return haystack[index:][i].name == needle.name })


log.Println(index, ret)


if ret < len(haystack) {
index += ret
log.Println("found", index, haystack[index])
}
}
}

-- 
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/tencent_659665C8263F2DF81643C2B86412244F3105%40qq.com.


[go-nuts] Re: How to call sort.Search in a loop

2022-10-11 Thread Brian Candler
sort.Search  is a binary chop, and needs an 
ordering condition, >= or <=.  If you use == then it cannot work.

In addition you're getting a panic here:

if ret < len(haystack) {
index += ret
log.Println("found", index, haystack[index])
}

by letting index increment past the end of the slice.

On Tuesday, 11 October 2022 at 13:22:29 UTC+1 ljh wrote:

> Hi community,
>
> I used sort.Search on a sorted slice in below code started at Line 36, and 
> it worked.
>
> I also tried to call sort.Search in a loop, started at Line 53. It does 
> not seem to work. How can I correct the loop version?
>
> Thanks
>
> ---
>
> package main
>
> import (
> "log"
> "sort"
> )
>
> type T struct {
> name string
> }
>
> func main() {
> log.SetFlags(log.LstdFlags | log.Llongfile)
>
> haystack := []T{
> // {name: "apple",  },
> {name: "compote", }, //dup
> {name: "orange", },
> {name: "compote", }, //dup
> }
>
> sort.Slice(haystack, func(i, j int) bool {
> if haystack[i].name < haystack[j].name {
> return true
> } else {
> return false
> }
> })
>
> for _, t := range haystack {
> log.Println("sorted", t)
> }
>
> needle := T{name: "compote"}
>
> // Style 1: ok, lower upper bounds style // Line 36
> /*
> lower := sort.Search(len(haystack), func(i int) bool {
> return haystack[i].name == needle.name
> })
>
> upper := sort.Search(len(haystack), func(i int) bool {
> return haystack[i].name > needle.name
> })
>
> if lower != len(haystack) {
> for i := lower; i != upper; i++ {
> log.Println("found", i, haystack[i])
> }
> }
> */
>
> // Style 2: error, loop style // Line 53
> for index := 0; index < len(haystack); index++ {
> ret := sort.Search(len(haystack[index:]), func(i int) bool { 
> return haystack[index:][i].name == needle.name })
>
> log.Println(index, ret)
>
> if ret < len(haystack) {
> index += ret
> log.Println("found", index, haystack[index])
> }
> }
> }
>
>

-- 
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/efc0960f-85f7-45b4-8099-a743665592bcn%40googlegroups.com.


Re: [go-nuts] How to call sort.Search in a loop

2022-10-11 Thread K. Alex Mills
sort.Search runs binary search. It's only guaranteed to work when you
provide it with a function which is monotonic -- true at index i implies
true at all indices greater than i.

Your loop style search does not provide a monotonic function, whereas your
"upper" function is monotonic. However, since "lower" is also not monotonic
I'd question whether the first approach would continue to work on larger
arrays. When testing binary search algorithms, it's important to use arrays
of many varying sizes, since the edge cases often don't appear on smaller
length lists.

In any case, on a sorted list, "upper" should be the only function you need
to determine whether the needle can be found in the list. sort.Search
guarantees that the index it returns is the first index where the monotonic
function changes its value. If the needle you're looking for is in the
haystack, the value at that index will be the needle itself.

On Tue, Oct 11, 2022, 7:22 AM 'ljh' via golang-nuts <
golang-nuts@googlegroups.com> wrote:

> Hi community,
>
> I used sort.Search on a sorted slice in below code started at Line 36, and
> it worked.
>
> I also tried to call sort.Search in a loop, started at Line 53. It does
> not seem to work. How can I correct the loop version?
>
> Thanks
>
> ---
>
> package main
>
> import (
> "log"
> "sort"
> )
>
> type T struct {
> name string
> }
>
> func main() {
> log.SetFlags(log.LstdFlags | log.Llongfile)
>
> haystack := []T{
> // {name: "apple",  },
> {name: "compote", }, //dup
> {name: "orange", },
> {name: "compote", }, //dup
> }
>
> sort.Slice(haystack, func(i, j int) bool {
> if haystack[i].name < haystack[j].name {
> return true
> } else {
> return false
> }
> })
>
> for _, t := range haystack {
> log.Println("sorted", t)
> }
>
> needle := T{name: "compote"}
>
> // Style 1: ok, lower upper bounds style // Line 36
> /*
> lower := sort.Search(len(haystack), func(i int) bool {
> return haystack[i].name == needle.name
> })
>
> upper := sort.Search(len(haystack), func(i int) bool {
> return haystack[i].name > needle.name
> })
>
> if lower != len(haystack) {
> for i := lower; i != upper; i++ {
> log.Println("found", i, haystack[i])
> }
> }
> */
>
> // Style 2: error, loop style // Line 53
> for index := 0; index < len(haystack); index++ {
> ret := sort.Search(len(haystack[index:]), func(i int) bool {
> return haystack[index:][i].name == needle.name })
>
> log.Println(index, ret)
>
> if ret < len(haystack) {
> index += ret
> log.Println("found", index, haystack[index])
> }
> }
> }
>
> --
> 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/tencent_659665C8263F2DF81643C2B86412244F3105%40qq.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/CALJzkY_JSC9pGUTuaXdzf1Wayq8%2BQUjpq2dT%3DqsQKhCcy1Sbgg%40mail.gmail.com.


Re: [go-nuts] How to call sort.Search in a loop

2022-10-11 Thread K. Alex Mills
Ah, my last post had a small mistake. A small modification to upper should
be all you need. The function should use >= instead of >. See below.

upper := sort.Search(len(haystack), func(i int) bool {
return haystack[i].name >= needle.name
})

On Tue, Oct 11, 2022, 7:38 AM K. Alex Mills  wrote:

> sort.Search runs binary search. It's only guaranteed to work when you
> provide it with a function which is monotonic -- true at index i implies
> true at all indices greater than i.
>
> Your loop style search does not provide a monotonic function, whereas your
> "upper" function is monotonic. However, since "lower" is also not monotonic
> I'd question whether the first approach would continue to work on larger
> arrays. When testing binary search algorithms, it's important to use arrays
> of many varying sizes, since the edge cases often don't appear on smaller
> length lists.
>
> In any case, on a sorted list, "upper" should be the only function you
> need to determine whether the needle can be found in the list. sort.Search
> guarantees that the index it returns is the first index where the monotonic
> function changes its value. If the needle you're looking for is in the
> haystack, the value at that index will be the needle itself.
>
> On Tue, Oct 11, 2022, 7:22 AM 'ljh' via golang-nuts <
> golang-nuts@googlegroups.com> wrote:
>
>> Hi community,
>>
>> I used sort.Search on a sorted slice in below code started at Line 36,
>> and it worked.
>>
>> I also tried to call sort.Search in a loop, started at Line 53. It does
>> not seem to work. How can I correct the loop version?
>>
>> Thanks
>>
>> ---
>>
>> package main
>>
>> import (
>> "log"
>> "sort"
>> )
>>
>> type T struct {
>> name string
>> }
>>
>> func main() {
>> log.SetFlags(log.LstdFlags | log.Llongfile)
>>
>> haystack := []T{
>> // {name: "apple",  },
>> {name: "compote", }, //dup
>> {name: "orange", },
>> {name: "compote", }, //dup
>> }
>>
>> sort.Slice(haystack, func(i, j int) bool {
>> if haystack[i].name < haystack[j].name {
>> return true
>> } else {
>> return false
>> }
>> })
>>
>> for _, t := range haystack {
>> log.Println("sorted", t)
>> }
>>
>> needle := T{name: "compote"}
>>
>> // Style 1: ok, lower upper bounds style // Line 36
>> /*
>> lower := sort.Search(len(haystack), func(i int) bool {
>> return haystack[i].name == needle.name
>> })
>>
>> upper := sort.Search(len(haystack), func(i int) bool {
>> return haystack[i].name > needle.name
>> })
>>
>> if lower != len(haystack) {
>> for i := lower; i != upper; i++ {
>> log.Println("found", i, haystack[i])
>> }
>> }
>> */
>>
>> // Style 2: error, loop style // Line 53
>> for index := 0; index < len(haystack); index++ {
>> ret := sort.Search(len(haystack[index:]), func(i int) bool {
>> return haystack[index:][i].name == needle.name })
>>
>> log.Println(index, ret)
>>
>> if ret < len(haystack) {
>> index += ret
>> log.Println("found", index, haystack[index])
>> }
>> }
>> }
>>
>> --
>> 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/tencent_659665C8263F2DF81643C2B86412244F3105%40qq.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/CALJzkY9O5F_trJAhp8i8jSdVOb7wf%2Brz06JEHu8GXoQuVPQkVQ%40mail.gmail.com.


[go-nuts] [security] Vulnerability in golang.org/x/text/language

2022-10-11 Thread Roland Shoemaker
Hello gophers,

Version v0.3.8 of golang.org/x/text fixes a vulnerability in the
golang.org/x/text/language package which could cause a denial of service.

An attacker can craft an Accept-Language header which ParseAcceptLanguage
will take significant time to parse.

This issue was discovered by OSS-Fuzz and reported to us by Adam Korczynski
(ADA Logics), and is tracked as CVE-2022-32149 and
https://go.dev/issue/56152.

Cheers,
Roland on behalf of the Go team

-- 
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/CADAOFNQDrikAwrnvORhY8Ze14SBJdR_A4Tb%2B%3DOfq%3DnNZyC4wbA%40mail.gmail.com.


回复: [go-nuts] How to call sort.Search in a loop

2022-10-11 Thread 'ljh' via golang-nuts
Hi community,


I improved my binary search example with both sort.Search and sort.Find. 
Please correct me if I got new wrongs with new example.


1. 


My original question was if there are duplicate entries in sorted slice. 
After I located the first dup, how can I go to the rest of them without loop.
I ever thought using loop was ugly, so I tried to avoid loop. 
But I think loop is ok. because dups are adjacent on sorted slice.


2.


How can I use tuple style comparison found in other languages, like:


  (a.name, a.num) > (b.name, b.num)


struct can be used for == only, not for <, >


3.


I think my conditions covered all the cases, but I need an extra trailing 
return ? 
Whats the right way to do it?


  if a < b {
    return -1
  } else if a == b {
    return 0
  } else if a > b {
    return 1
  }


  return -999 // an extra return




Thanks




//---


//sort.Search example
func sortSearch() {
  haystack := []T{
    {"aaa", 111},
    {"bbb", 222}, //dup
    {"bbb", 222}, //dup
    {"ccc", 333},
  }
  needle := T{"bbb", 222}


  index := sort.Search(len(haystack), func(i int) bool {
    //asc >=
    //desc <=
    if haystack[i].name >= needle.name ||
      haystack[i].name == needle.name &&
      haystack[i].num >= needle.num {
        return true;
    }


    return false
  })


  log.Println(index)


  for i := index; i < len(haystack); i++ {
    if haystack[i] == needle {
      log.Println(i, haystack[i])
    } else {
      break
    }
  }
}




//sort.Find example
func sortFind() {
  log.SetFlags(log.LstdFlags | log.Llongfile)


  haystack := []T{
    {"aaa", 111},
    {"bbb", 222}, //dup
    {"bbb", 222}, //dup
    {"ccc", 333},
  }
  needle := T{"bbb", 222}


  i, found := sort.Find(len(haystack), func(i int) int {
    //asc -1 0 1
    //desc 1 0 -1
    if needle.name < haystack[i].name ||
      needle.name == haystack[i].name &&
      needle.num < haystack[i].num {
        return -1
    } else


    if needle == haystack[i] {
      return 0
    } else


    if needle.name > haystack[i].name ||
      needle.name == haystack[i].name &&
      needle.num > haystack[i].num {
        return 1
    }


    return 9 // do i have to add this line // Line 66
  })


  log.Println(found, i)


  for i := i; found && i != len(haystack); i++ {
    if haystack[i] == needle {
      log.Println(i, haystack[i])
    } else {
      break
    }
  }
}

-- 
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/tencent_9C30B68D792641F2B863FB873EF31B825309%40qq.com.


[go-nuts] workspace question

2022-10-11 Thread Steve Roth
I'd appreciate help with setting up a workspace, involving two modules that
exist only on my local disk and not in any SCM.  I understand how to create
the workspace and use both modules in it.  What I can't figure out is how
to add a dependency from mod1 to mod2 in mod1's go.mod file.

The supported means of adding dependencies in go.mod files is the go get
command.  But if I go into mod1's directory and run "go get path/to/mod2",
it tries to download it from github and fails.  I cannot figure out how to
tell go get to use the version that's on my local disk, even though the
workspace says it should.

Similarly, I can't figure out how to add the necessary go.mod and go.sum
entries manually.  The documentation explicitly warns against trying to do
so, anyway.

It seems like this is exactly the case workspaces were designed for,
developing two modules at once, and yet I've had no success in getting it
set up.  Any suggestions?

Regards,
Steve

-- 
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/CAAnpqKFYPXiLQ0E3-mE2RT-XpkzHeHfwFu3mOJKfWqMht7ebRw%40mail.gmail.com.


[go-nuts] The effect go test -v flag on local directory mode and package list mode

2022-10-11 Thread Jingguo Yao
I have the following directory layout:

├── bar
│   └── bar_test.go
├── foo
│   └── foo_test.go
├── go.mod
└── go.sum


foo_test.go:
package main

import (
"fmt"
"testing"
)

func TestHelloWorld(t *testing.T) {
fmt.Println("hello, foo")
t.Log("hi, foo")
}

bar_test.go:
package bar

import (
"fmt"
"testing"
)

func TestGreeting(t *testing.T) {
fmt.Println("hello, bar")
t.Log("hi, bar")
}


$ go test -count=1 -v ./...
=== RUN   TestGreeting
hello, bar
bar_test.go:10: hi, bar
--- PASS: TestGreeting (0.00s)
PASS
ok  yao.org/lang/bar0.814s
=== RUN   TestHelloWorld
hello, foo
foo_test.go:10: hi, foo
--- PASS: TestHelloWorld (0.00s)
PASS
ok  yao.org/lang/foo0.518s

$ go test -count=1  ./...
ok  yao.org/lang/bar0.115s
ok  yao.org/lang/foo0.210s

foo$ go test -v -count=1
=== RUN   TestHelloWorld
hello, foo
foo_test.go:10: hi, foo
--- PASS: TestHelloWorld (0.00s)
PASS
ok  yao.org/lang/foo0.271s

foo$ go test -count=1
hello, foo
PASS
ok  yao.org/lang/foo0.105s

I found the following different effects on two test modes by -v flag.

1. -v enables the output of fmt.Println and T.Log statements in package 
list mode.
2. -v enables the output of T.Log statements in local directory mode.

I browsed https://pkg.go.dev/cmd/go. But I failed to find a description of
this difference. Does this difference work as designed? If yes, can we 
document
it explicitly?

I am using go version go1.19.1 darwin/amd64.

Jingguo

-- 
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/08c254c2-fcd9-4449-8625-cbf912f12f73n%40googlegroups.com.


Re: [go-nuts] workspace question

2022-10-11 Thread Jan Mercl
On Wed, Oct 12, 2022 at 4:49 AM Steve Roth  wrote:
>
> I'd appreciate help with setting up a workspace, involving two modules
that exist only on my local disk and not in any SCM.  I understand how to
create the workspace and use both modules in it.  What I can't figure out
is how to add a dependency from mod1 to mod2 in mod1's go.mod file.
>
> The supported means of adding dependencies in go.mod files is the go get
command.  But if I go into mod1's directory and run "go get path/to/mod2",
it tries to download it from github and fails.  I cannot figure out how to
tell go get to use the version that's on my local disk, even though the
workspace says it should.
>
> Similarly, I can't figure out how to add the necessary go.mod and go.sum
entries manually.  The documentation explicitly warns against trying to do
so, anyway.
>
> It seems like this is exactly the case workspaces were designed for,
developing two modules at once, and yet I've had no success in getting it
set up.  Any suggestions?

For example:

jnml@3900x:~/tmp/modules/bar$ rm -rf *
jnml@3900x:~/tmp/modules/bar$ go mod init example.com/bar
go: creating new go.mod: module example.com/bar
jnml@3900x:~/tmp/modules/bar$ echo 'package bar; func Y() {}' > bar.go
jnml@3900x:~/tmp/modules/bar$

and

jnml@3900x:~/tmp/modules/foo$ rm -rf *
jnml@3900x:~/tmp/modules/foo$ go mod init example.com/foo
go: creating new go.mod: module example.com/foo
jnml@3900x:~/tmp/modules/foo$ echo 'package foo; import "example.com/bar";
func X() { bar.Y() }' > foo.go
jnml@3900x:~/tmp/modules/foo$ go build -v
foo.go:1:21: no required module provides package example.com/bar; to add it:
go get example.com/bar
jnml@3900x:~/tmp/modules/foo$ go work init
jnml@3900x:~/tmp/modules/foo$ go work use ../bar
jnml@3900x:~/tmp/modules/foo$ go build -v
directory . is contained in a module that is not one of the workspace
modules listed in go.work. You can add the module to the workspace using go
work use .
jnml@3900x:~/tmp/modules/foo$ go work use .
jnml@3900x:~/tmp/modules/foo$ go build -v
jnml@3900x:~/tmp/modules/foo$

HTH

-j

-- 
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/CAA40n-UP8jVVE81AskP9GKFSd63Gkv7cT2jqDBAkZZ0v-2ENPg%40mail.gmail.com.