[go-nuts] How to call function from struct in slice?

2022-06-02 Thread Jay
In a code example, I’m confuse if it’s possible to call ModuleName() each package API after execute CompileModules()? app.go func CompileModules() []interface{ return []interface{ Example1.AddModule(), Example2.AddModule(), Example3.AddModule(), } }

[go-nuts] How to call Name() from slice?

2022-06-02 Thread Jay
In a code example, I’m confuse if it’s possible to call ModuleName() each package API after execute CompileModules()? app.go func CompileModules() []interface{ return []interface{ Example1.AddModule(), Example2.AddModule(), Example3.AddModule(), } }

[go-nuts] [Advice needed] How to vendor common dependencies for plugins

2018-03-07 Thread Jay Guo
Golang gurus, I'm currently trying to modularize my project with the help of Golang plugin, and I come across this dependency vendoring dilemma. Let's say we have a project layout: - Two different projects in separate repo: `Host` and `Guest` - `Host` depends on package `pkgA` - `Guest

[go-nuts] Re: [Advice needed] How to vendor common dependencies for plugins

2018-03-11 Thread Jay Guo
Bump.. any thoughts? Thanks! - J On Thursday, March 8, 2018 at 2:03:37 PM UTC+8, Jay Guo wrote: > > Golang gurus, > > I'm currently trying to modularize my project with the help of Golang > plugin, and I come across this dependency vendoring dilemma. > > Let'

Re: [go-nuts] Re: [Advice needed] How to vendor common dependencies for plugins

2018-03-18 Thread Jay Guo
pect to get from using them? > > On Sun, Mar 11, 2018 at 1:03 AM Jay Guo wrote: > >> Bump.. any thoughts? Thanks! >> >> - J >> >> >> On Thursday, March 8, 2018 at 2:03:37 PM UTC+8, Jay Guo wrote: >>> >>> Golang gurus, >>> >&g

[go-nuts] Struct members, hide or export?

2018-08-09 Thread Jay Guo
Let's say I'm writing some library for internal usage in my project, what's the idiomatic way to design visibility of struct members? - Option 1. export structs and members as much as possible. Only hide ones that need to be protected, e.g. by a lock - Option 2. hide as much as possible

Re: [go-nuts] Re: Struct members, hide or export?

2018-08-09 Thread Jay G
On Thu, Aug 9, 2018 at 8:14 PM Manlio Perillo wrote: > > > > On Thursday, August 9, 2018 at 9:50:55 AM UTC+2, Jay G wrote: >> >> Let's say I'm writing some library for internal usage in my project, what's >> the idiomatic way to design visibility of s

[go-nuts] Regarding string immutablity

2018-08-28 Thread Jay Sharma
Hi All, I went through documentation and many post. Every where it is specified *strings are immutable*. I have some string : x := "teststring" I want to *wipe out/overwrite* the content of this string x from disk/memory. As per me the simplest way to do this: x = "" or If I want to ov

[go-nuts] Re: Regarding string immutablity

2018-08-28 Thread Jay Sharma
e the same memory or it will create some copy ? @Jake Montgomery, It is about *security*. I have some keys and I want to delete the content of key, when no longer required. Here my API is expecting a string key. On Tuesday, August 28, 2018 at 8:25:27 PM UTC+5:30, Jay Sharma wrote: > >

[go-nuts] Re: compiling from within vim not working

2018-11-18 Thread Jay Ts
On Saturday, November 17, 2018 at 11:16:08 AM UTC-7, rob wrote: > > Hi. I'm interested in trying the internal compiling option for Go. > > Vim 7.4. Ubuntu 16.04 amd64 > > go 1.11.2 > > I'm using the version of vim that gets installed by apt. > > When I type :make from a window showing a buf

Re: [go-nuts] Re: go language sensitive editor?

2018-11-23 Thread Jay Ts
Hi Rob, Thanks for the link to that talk. I had many of the same early experiences, including using an IBM keypunch and interacting with an IBM 360 (programming in APL) over a modem line. My first programming job was in 1981 on a VAX11/780 running UNIX/32V (with 7th edition manuals) in the Cal

[go-nuts] In `WaitGroup`, why should `Add(positive delta)` called before `Wait` if counter is 0?

2017-10-10 Thread Jay Guo
Hi, It is suggested in https://golang.org/pkg/sync/#WaitGroup that: // Note that calls with a positive delta that occur when the counter is zero // must happen before a Wait. I wonder what's the reason in terms of `sync` implementation. Essentially I'm trying to implement following logic: for

Re: [go-nuts] In `WaitGroup`, why should `Add(positive delta)` called before `Wait` if counter is 0?

2017-10-10 Thread Jay Guo
ue, Oct 10, 2017 at 9:42 PM, Ian Lance Taylor wrote: > On Tue, Oct 10, 2017 at 5:34 AM, Jay Guo wrote: > > > > It is suggested in https://golang.org/pkg/sync/#WaitGroup that: > > > > // Note that calls with a positive delta that occur when the counter is > zero > >

Re: [go-nuts] In `WaitGroup`, why should `Add(positive delta)` called before `Wait` if counter is 0?

2017-10-10 Thread Jay Guo
Yep. Thanks! cheers, - J On Tue, Oct 10, 2017 at 11:01 PM, Ian Lance Taylor wrote: > On Tue, Oct 10, 2017 at 7:56 AM, Jay Guo wrote: > > > > In my use case, both cases you presented are valid and I don't really > need > > to disambiguate them. So I guess cal

[go-nuts] gomobile + go protobuf

2017-11-08 Thread jay . graves
arget=android . I get the following error. Skabber:go-protobuf-test jay$ gomobile bind -target=android . gomobile: go build -pkgdir=/Users/jay/go/pkg/gomobile/pkg_android_arm - buildmode=c-shared -o=/var/folders/c3/8ydc1rk94kd7p9bcrkh85500gn/T/ gomobile-work-563639487/android/src/main/jniLibs/ar

[go-nuts] Re: gomobile + go protobuf

2017-12-06 Thread jay . graves
droid That compiles the Android .aar file just fine. On Tuesday, December 5, 2017 at 2:03:37 PM UTC-7, William Quintal wrote: > > I have the same issue , did you find a solution ? > > Le mercredi 8 novembre 2017 19:49:17 UTC-5, Jay Graves a écrit : >> >> I've been tryi

[go-nuts] x/mobile: Launch a android application with given package name [String] in go

2019-08-25 Thread Jay Sharma
Hello All, *Following is the function written in go:* func LaunchApplication(packageName string) { Query : how can I execute application with given packageName } Generated the java binding [.aar] using *gomobile*. I want to include .aar generated in my android application and call *Laun

[go-nuts] x/mobile: Samples for reverse binding in gomobile

2019-09-06 Thread Jay Sharma
Hello All, *I can not see any samples for reverse binding (Calling function from go layer of java layer) in gomobile.* Is anybody tried any samples of reverse binding. Thank in advance. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsu

[go-nuts] Re: x/mobile: Samples for reverse binding in gomobile

2019-09-09 Thread Jay Sharma
PM UTC+5:30, Elias Naur wrote: > > > > fredag den 6. september 2019 kl. 13.29.33 UTC+2 skrev Jay Sharma: >> >> Hello All, >> >> *I can not see any samples for reverse binding (Calling function from go >> layer of java layer) in gomobile.* >> >>

Re: [go-nuts] Re: x/mobile: Samples for reverse binding in gomobile

2019-09-10 Thread Jay Sharma
code -6 in tid 9423 (Thread-2) *Can you please provide you opinion. Let me know if any other information is needed. * Thanks On Monday, September 9, 2019 at 5:40:25 PM UTC+5:30, Elias Naur wrote: > > On Mon Sep 9, 2019 at 3:09 AM Jay Sharma wrote: > > > > *Next I want

Re: [go-nuts] Re: x/mobile: Samples for reverse binding in gomobile

2019-09-10 Thread Jay Sharma
Just one more information: I am calling from my go code like this: RBinding.GetStringFromJava() On Tuesday, September 10, 2019 at 4:56:00 PM UTC+5:30, Jay Sharma wrote: > > Hello @elias, > > I tried the following: > > 1. Created a java class : > > package reverseb

Re: [go-nuts] Re: x/mobile: Samples for reverse binding in gomobile

2019-09-11 Thread Jay Sharma
On Tue Sep 10, 2019 at 4:26 AM Jay Sharma wrote: > > --=_Part_1258_983331168.1568114760099 > > Content-Type: text/plain; charset="UTF-8" > > > > Hello @elias, > > > > I tried the following: > > > > 1. Created a java class :

Re: [go-nuts] Re: x/mobile: Samples for reverse binding in gomobile

2019-09-11 Thread Jay Sharma
r 11, 2019 at 4:36:20 PM UTC+5:30, Elias Naur wrote: > > On Wed Sep 11, 2019 at 3:51 AM Jay Sharma wrote: > > > > > > I have one doubt when we build using gomobile in that I am giving the > > classpath to my .class java file. > > *Will it be included in .a

Re: [go-nuts] Re: x/mobile: Samples for reverse binding in gomobile

2019-09-12 Thread Jay Sharma
Object { return Object.New() } *How can I modify it for my class ? * I know, It is too much to ask. I got confused. *Thanks for your help.* On Wednesday, September 11, 2019 at 9:41:13 PM UTC+5:30, Elias Naur wrote: > > On Wed Sep 11, 2019 at 7:20 AM Jay Sharma wrote: > > > &

Re: [go-nuts] Re: x/mobile: Samples for reverse binding in gomobile

2019-09-12 Thread Jay Sharma
ng class name: it is working fine. but with object it is not working.* *Can you please provide your suggestion ? * *Thanks.* On Thursday, September 12, 2019 at 1:14:21 PM UTC+5:30, Jay Sharma wrote: > > Hello Elias, > > Following are the lines from proposals: > Creating new

Re: [go-nuts] Re: x/mobile: Samples for reverse binding in gomobile

2019-09-12 Thread Jay Sharma
Hello Elias, *First of all, Thank you very much for help. :)* *After I remove the static from function it worked well. * *Thanks* On Thursday, September 12, 2019 at 4:31:05 PM UTC+5:30, Elias Naur wrote: > > On Thu Sep 12, 2019 at 2:35 AM Jay Sharma wrote: > > >

[go-nuts] runtime/malloc: out of memory when only 512GB / 4TB in use

2017-06-30 Thread Jeremy Jay
We've got a very high-memory (4TB) system available that I'm trying to make full use of. Anyone have any pointers on how to track down this issue? Is it a system configuration thing, a go malloc bug, or something else? Thanks! Snippet of the crash follows: fatal error: out of memory fatal erro

[go-nuts] Re: runtime/malloc: out of memory when only 512GB / 4TB in use

2017-07-02 Thread Jeremy Jay
On Sunday, July 2, 2017 at 3:58:38 AM UTC-4, Sokolov Yura wrote: > > If you have a lot of "raw" data (ie without pointers), consider moving it > into mmap-ed slice. You will loose convenience of GC though (you will have > to manage those memory by yourself). This was definitely on my list if n

[go-nuts] unambiguous = simplicity

2020-07-16 Thread Jay Kay
Which code snippet(s) in GO would be 100 percent unambiguous as generics: a) [g] b) {g} c) d) «g» -- 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+un

Re: [go-nuts] Re: Generics and parentheses

2020-07-17 Thread Jay Kay
How about a "-generics" compile flag that lets you select one pair from a character set of [ ( { < « . On Friday, July 17, 2020 at 8:56:32 AM UTC-7 Jon Conradt wrote: > In the spirit of “show me, don’t tell me” and experience reports. How hard > would it be to release a beta which supports both

[go-nuts] Assign to struct field dynamically (type t does not support indexing)

2021-05-21 Thread Jay Adams
Greetings, I need to be able to assign a value to a struct field where I specify the field name in a variable. After searching around I thought the following approach would work but I still get the "type does not support indexing" error. This example is simplified: type item struct { red boo

[go-nuts] Named pipes blocking with O_NONBLOCK on Mac

2024-03-11 Thread Jay Goel
est example I can find to reproduce the issue. The full program listing is here: https://gist.github.com/poundifdef/76377b75b15826baccab83cd501d0c85 Thank you, Jay Goel -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

Re: [go-nuts] Re: Go 1.14 is released

2020-02-26 Thread &#x27;Jay Conrod' via golang-nuts
Both pages were moved to the x/website repository so they could be kept up to date outside the 6-month release cycle. On Wed, Feb 26, 2020 at 7:33 AM HaWe wrote: > Firts of all, many thanks for a great new release. > >

Re: [go-nuts] `go list` across multiple modules?

2021-01-15 Thread &#x27;Jay Conrod' via golang-nuts
I was initially going to suggest adding the module subdirectories as requirements to the main go.mod, then replacing those with the subdirectories. module example.com/m go 1.15 require ( example.com/other1 v0.0.0 example.com/other2 v0.0.0 example.com/m/submod v0.0.0 ) replace ( example.

Re: [go-nuts] `go list` across multiple modules?

2021-01-19 Thread &#x27;Jay Conrod' via golang-nuts
If you need dependencies or reverse dependencies, 'go list' or go/packages are probably the right tools. On Fri, Jan 15, 2021 at 6:43 PM Tim Hockin wrote: > On Fri, Jan 15, 2021 at 2:17 PM Jay Conrod wrote: > > > > I was initially going to suggest adding the m

Re: [go-nuts] `go list` across multiple modules?

2021-01-19 Thread &#x27;Jay Conrod' via golang-nuts
2021 at 10:02 AM Jay Conrod wrote: > > Interesting - is the difference the absolute paths vs relative? > > It looks like the bug has to do with whether the directory is below the > main module root directory or not. If it is, the go command takes a path > that assumes it's pa

Re: [go-nuts] `go list` across multiple modules?

2021-01-20 Thread &#x27;Jay Conrod' via golang-nuts
2021 at 8:06 PM Tim Hockin wrote: > > > On Tue, Jan 19, 2021 at 7:54 AM Jay Conrod wrote: > >> By the way, I'm not sure if you're already doing this, but if you can >> batch all of the `go list` runs (or go/packages >> <https://goto.google.com/packages>.L

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

2021-03-18 Thread &#x27;Jay Conrod' via golang-nuts
Hey Tim, thanks for writing this up. These kinds of reports are helpful. I'll try to respond to a few problems individually. *1. Command installation with "go install"* There are basically two ways to do this, depending on whether you want to install the command within the context of your current

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

2021-03-22 Thread &#x27;Jay Conrod' via golang-nuts
or vendor/modules.txt. it basically contains enough information for the go command to know which packages are vendored and which modules they came from. On Sat, Mar 20, 2021 at 12:47 PM Manlio Perillo wrote: > Il giorno venerdì 19 marzo 2021 alle 23:20:49 UTC+1 Tim Hockin ha scritto: > >&

Re: [go-nuts] proposal: infer module name via version control when running `go mod init`

2021-05-12 Thread &#x27;Jay Conrod' via golang-nuts
The go command used to infer the module path from .git/config for github origins specifically. However, that was removed in 1.13, based on discussion in #27951 . It wasn't a strong enough signal, and since it's important to get the module path right early

Re: [go-nuts] how to purge invalid tags from GOPROXY?

2021-06-30 Thread &#x27;Jay Conrod' via golang-nuts
Hi Sebastien, once a version is in proxy.golang.org, it usually can't be removed. This is important to ensure that builds continue working when a repository disappears upstream. You may want to publish a new version with a retract directive in go.mod, marking the earlier versions as invalid. In Go

Re: [go-nuts] how to purge invalid tags from GOPROXY?

2021-07-01 Thread &#x27;Jay Conrod' via golang-nuts
As Dan mentioned, the version containing the retractions must be the highest version, so you'd need to tag v1.4.3 or higher. If that version retracts itself, it won't appear in the version list either. On Thu, Jul 1, 2021 at 1:58 AM Sebastien Binet wrote: > Hi Jay, > > On Th

Re: [go-nuts] Showing effective replace in go modules

2021-07-30 Thread &#x27;Jay Conrod' via golang-nuts
The go command only applies replace directives from the main module's go.mod file. In this example, replace directives in your module B would be applied, but replace directives in A (or any other dependency) would be ignored. This is important for avoiding conflicts that can't easily be resolved (f

Re: [go-nuts] Re: go install an/import/path@revision and /vendor in Go 1.16

2021-08-06 Thread &#x27;Jay Conrod' via golang-nuts
Indeed, this should be better documented. I've mailed CL 340509 to mention in a couple places in /ref/mod that vendor directories are omitted from zip files. On Fri, Aug 6, 2021 at 3:55 AM Brian Candler wrote: > On Friday, 6 August 2021 at

Re: [go-nuts] `go list` across multiple modules?

2021-08-11 Thread &#x27;Jay Conrod' via golang-nuts
is a back-burner exploration for me, so >> I am not in a panic. Every now and again I will circle back and see if >> anything new happens :) >> >> On Wed, Jan 20, 2021 at 10:50 AM Jay Conrod wrote: >> >>> You appear to have discovered another new bug. Sorry

Re: [go-nuts] go.sum security error

2021-08-16 Thread &#x27;Jay Conrod' via golang-nuts
This doesn't seem like a problem with Go versions. The security error is correct. It looks like the module author tagged v1.1.1 with this go.mod file then changed the tag to point to a different commit with this file

Re: [go-nuts] Go mod ignoring project sub-modules

2021-08-16 Thread &#x27;Jay Conrod' via golang-nuts
Hi Nic, This is actually working as intended, though I don't think we've adequately documented it. I've sent CL 342531 to mention this in the reference documentation. In short though, files in a subdirectory that contains a go.mod file are c

[go-nuts] Share your thoughts about Go’s built-in fuzzing

2021-08-17 Thread &#x27;Jay Conrod' via golang-nuts
Hi, earlier this year the Go Fuzzing Team released a public preview of built-in fuzzing support in Go. Now that folks have had some time to experiment with it, we’d love to learn more about what’s working well and what could be improved. If you’ve tried out Go’s

Re: [go-nuts] Go mod ignoring project sub-modules

2021-08-17 Thread &#x27;Jay Conrod' via golang-nuts
directives, 4) commit the change in B, 5) tag a release in B, and 6) update A's dependency on B. On Mon, Aug 16, 2021 at 11:25 PM Nicholas Bunn wrote: > Thanks for the prompt response, Jay! > > And thanks for clearing that up, it's good to know that it's intended to &

Re: [go-nuts] go.sum security error

2021-08-17 Thread &#x27;Jay Conrod' via golang-nuts
I think the problem is in go.sum. If it already contains an incorrect sum for a module version, the go command will report a security error when downloading that version (if the download has a different sum) or when using that version (if the cached version had a different sum that appeared to be v

Re: [go-nuts] go.sum security error

2021-08-17 Thread &#x27;Jay Conrod' via golang-nuts
752> for this. On Tue, Aug 17, 2021 at 9:05 AM Jay Conrod wrote: > I think the problem is in go.sum. If it already contains an incorrect sum > for a module version, the go command will report a security error when > downloading that version (if the download has a different sum) or whe

Re: [go-nuts] Leading dash invalid in test filename inside module

2021-08-18 Thread &#x27;Jay Conrod' via golang-nuts
You're exactly right, the proxy is still in the process of migrating to Go 1.17. It should be done in the next day or two, at which point it should be able to fetch this version. In the mean time, you can work around it by setting GOPRIVATE= github.com/benhoyt/goawk

Re: [go-nuts] Does the module name have to include the repo name when you publish a Go module?

2021-09-07 Thread &#x27;Jay Conrod' via golang-nuts
The module path doesn't need to match the repo URL, but if other modules depend on your module, then the go command needs to be able to find your repository given your module path. The lexical constraints for module paths are documented at https://golang.org/ref/mod#go-mod-file-ident. In short, th

Re: [go-nuts] Does the module name have to include the repo name when you publish a Go module?

2021-09-07 Thread &#x27;Jay Conrod' via golang-nuts
The module path needs to be part of a valid URL, but it doesn't have to be the same as the repository URL. That's what my golang.org/x/mod example was meant to demonstrate. The repository is hosted on a different domain. On Tue, Sep 7, 2021 at 1:05 PM Dean Schulze wrote: > Your first paragraph s

Re: [go-nuts] How to automatically embed module name from go.mod into executables?

2021-10-08 Thread &#x27;Jay Conrod' via golang-nuts
Good news! The main package path, the containing module, and all of the dependencies and their versions are already embedded in Go executables. You can read that info with `go version -m path/to/exe`. $ go install golang.org/x/tools/cmd/stringer@latest $ go version -m ~/go/bin/stringer /Users/jay