[go-nuts] Re: c-shared library for Aix

2024-03-03 Thread 'TheDiveO' via golang-nuts
llvm/clang? I've ditched gcc because of its many unfixable problems. After 
loosing quite some time, trying to cross-compile Go using gcc, I've 
switched to clang IIRC and this works beautifully, especially 
cross-building for Alpine/musl. However my AIX time with RS6000 was decades 
ago, and I was the one constantly turning up new kernel bugs from user 
space.

On Saturday, March 2, 2024 at 6:42:56 PM UTC+1 Anshuman Mor wrote:

> I have written multiple c-shared libraries code in golang for Windows, 
> Linux, MacOS . I am using GCC cross compiler for the same. This code is 
> running fine in production without any issue since last 3 years.
>
> But, we have recently got a requirement to compile the same thing for 
> AIX/PowerPC but I am afraid that go compiler doesn't support this out of 
> the box, I tried many approaches but none worked like - 
>
> 1. Using gccgo compiler but this errors out with "Thread Local Storage" 
> error.
> 2. Using c-archive and then convert to shared using gcc compiler, this 
> also errors out with something or other.
>
> Has anyone done similar type of work for Aix? Any help would be greatly 
> appreciated.
>

-- 
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/46aae3da-4197-4dc1-b35c-985f5998226fn%40googlegroups.com.


[go-nuts] Enums, Go1 and proposals

2024-03-03 Thread Nicolas Serna
Hello, gophers. Lately I've been working quite a bit with enums as I'm 
moving a C program I had to Go, so I wondered if there was any progress on 
enums proposals and realized that none of them get anywhere without 
breaking the Go1 compatibility.

I've decided to get a bit creative and share with you the proposals I've 
thought of. 

The fundamental thing when we talk about the incorporation of "robust 
enums" is, similarly to the case of generics, to propose a syntax extension 
to the language without breaking compatibility with the previous software.

We use enumerations simply to handle states and encapsulate them under a 
name. Therefore I wanted to propose the following syntax:

```proposal
const ()   = 
```

The idea of this syntax is that, roughly speaking, it reminds us of what we 
do when we declare a method, with the only difference that in this case we 
use constant values associated to some "enum type". Then, we should be able 
to call our constants as follows: ., the same 
would be true for an already instantiated type.

```example
type Statement struct{ /* ... */ } 

type StatementTyp int 

const (Statement) (
 Prepared StatementTyp = iota
 Success
 Fail
)

func main() {
stmt := Statement{}
fmt.Println(Statement.Prepared) // 0
fmt.Println(stmt.Success) // 1
}
```

Realistically speaking this doesn't solve much. It just gives us a way to 
encapsulate constants in an "elegant" way and keeps the "const-iota" 
syntax, but little else.

I think it is essential to have an extra way to reference these internal 
values of a type so that we can work with the help of the go-typechecker. 
For this I could only come up with two types of syntax, let's see:

```prop1
var bar const 

func foo(arg const ) {...}
```
```prop2
var foo .const

func bar(arg .const)
```

That would be all, I hope you can give some feedback and know what you 
think. I read in the go2-language-template 
 
that it was better to post my ideas in this group instead of making a issue.

Thanks for reading ^^

-- 
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/134fd31b-9081-4d22-b098-412244338fc5n%40googlegroups.com.


Re: [go-nuts] Re: 64 Tiny Algorithmic Puzzles in Go

2024-03-03 Thread BUGFIX 66
Exactly!

On Sat, Mar 2, 2024 at 8:37 PM peterGo  wrote:

> qiulaidongfeng,
>
> A simpler, solution:
>
> https://go.dev/play/p/gLY7O_hwyxI
>
> peter
>
> On Saturday, March 2, 2024 at 8:25:33 PM UTC-5 qiulaidongfeng wrote:
>
>> I wrote a correct one, as shown here:
>> https://go.dev/play/p/IDJP_iIsGDE
>>
>> On Sunday, March 3, 2024 at 1:42:51 AM UTC+8 BUGFIX 66 wrote:
>>
>>> https://BUGFIX-66.com
>>>
>>> Solve each puzzle by making a tiny change to a short piece of Go code.
>>> Edited code is compiled and tested on the host server.
>>> Each puzzle is a useful little algorithm or idea.
>>> Unfortunately, most users can't solve puzzle #3 and give up.
>>> Enjoy.
>>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "golang-nuts" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/golang-nuts/2bjj9Ftm0zw/unsubscribe.
> To unsubscribe from this group and all its topics, 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/1f2d2c9b-0b07-4030-8f49-37f22210be8en%40googlegroups.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/CAL3VaP25eoT3Ho-cW7wHd4-GLo%2BTyzM6B3_i2rwe8_RzqoQ_cQ%40mail.gmail.com.


[go-nuts] Data structure code review

2024-03-03 Thread Miss Adorable
Hi! I wrote 
 
my first data structure in Go. I wonder how idiomatic my code is to enhance 
it. Previously, I had C# and Java experience.


-- 
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/34b9d900-7571-45d1-ae75-21a021d4c75fn%40googlegroups.com.


[go-nuts] GO111MODULE=off go get deprecated?

2024-03-03 Thread Jeffery Carr
Has this been deprecated or maybe it is broken in debian sid, but:

bash$ GO111MODULE=off go get -v go.wit.com/apps/test
go: modules disabled by GO111MODULE=off; see 'go help modules'
basj$ go version 
go version go1.22.0 linux/amd64

this doesn't work anymore. Also, 'go help modules' is less than helpful.

Is there some other way to download the actual sourcecode into 
~/go/src/mything/ anymore?

This functionality was _PERFECT_ in my experience. I can't even imagine why 
it would be deprecated. How in the world are you all developing complicated 
software using GO without this working? Is this why everyone has gazillions 
of internal/ packages and massive git repos?

Thanks in advance for any advice,
jcarr

-- 
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/8a3d883a-039e-4a95-8fc4-ff9fc0b874c2n%40googlegroups.com.


[go-nuts] Query Regarding ASAN C Call from Go Code

2024-03-03 Thread Evgeny Chormonov
I noticed that ASAN checker in the Go source code is defined using CGO 
https://github.com/golang/go/blob/master/src/runtime/asan/asan.go
But the C ASAN functions are called from the Go runtime using assembly code 
instead of a common CGO call. 
https://github.com/golang/go/blob/master/src/runtime/asan_amd64.s#L36

This discovery has sparked my interest, and I am curious to know if I can 
employ a similar method to execute my own C functions from my Go code. 
Could you clarify if this is a viable option?

-- 
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/062a3506-cd4a-45ef-b05e-5730e6923c43n%40googlegroups.com.


Re: [go-nuts] GO111MODULE=off go get deprecated?

2024-03-03 Thread Ian Lance Taylor
On Sun, Mar 3, 2024 at 1:25 PM Jeffery Carr  wrote:
>
> Has this been deprecated or maybe it is broken in debian sid, but:
>
> bash$ GO111MODULE=off go get -v go.wit.com/apps/test
> go: modules disabled by GO111MODULE=off; see 'go help modules'
> basj$ go version
> go version go1.22.0 linux/amd64
>
> this doesn't work anymore. Also, 'go help modules' is less than helpful.
>
> Is there some other way to download the actual sourcecode into 
> ~/go/src/mything/ anymore?
>


I think you may be seeing a bad error message.  `go get
go.wit.com/apps/test` doesn't work whether you are in module mode or
not.  With Go 1.21 I get

> GO111MODULE=off ~/go1.21/bin/go get -v go.wit.com/apps/test
package go.wit.com/apps/test: unrecognized import path
"go.wit.com/apps/test": parse https://go.wit.com/apps/test?go-get=1:
no go-import meta tags ()

I filed https://go.dev/issue/66080 for the odd difference in error messages.

> This functionality was _PERFECT_ in my experience. I can't even imagine why 
> it would be deprecated. How in the world are you all developing complicated 
> software using GO without this working? Is this why everyone has gazillions 
> of internal/ packages and massive git repos?

Most people simply use modules with no internal packages and with git
repos that contain only their own code.  That's kind of the point of
modules, in fact.  When I want to see the source code of an imported
module, I build the package using `go build`, and then look in
$GOPATH/pkg/mod.

Ian

-- 
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/CAOyqgcU9OvSsdA8m6qXwcwuF8a-B4MxKVhaeHGPvVsM3ceAkvQ%40mail.gmail.com.


Re: [go-nuts] Query Regarding ASAN C Call from Go Code

2024-03-03 Thread Ian Lance Taylor
On Sun, Mar 3, 2024 at 1:25 PM Evgeny Chormonov  wrote:
>
> I noticed that ASAN checker in the Go source code is defined using CGO 
> https://github.com/golang/go/blob/master/src/runtime/asan/asan.go
> But the C ASAN functions are called from the Go runtime using assembly code 
> instead of a common CGO call. 
> https://github.com/golang/go/blob/master/src/runtime/asan_amd64.s#L36
>
> This discovery has sparked my interest, and I am curious to know if I can 
> employ a similar method to execute my own C functions from my Go code. Could 
> you clarify if this is a viable option?

Viable is in the eyes of the beholder.  You can use a similar method.
But you have to hand-write the assembler code for each C function you
want to call.  And if the C function ever blocks on, say, network I/O,
your entire Go program can hang unexpectedly.  We only use this
technique for ASAN because we have a very limited number of functions
to call, and we know for sure that those functions can never block.

Ian

-- 
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/CAOyqgcVQ9zZaggpik5tu%3DvgYucUWXY57K601-a%3D6d4SXg_kidQ%40mail.gmail.com.


Re: [go-nuts] Data structure code review

2024-03-03 Thread Steven Hartland
Some feedback:
Instead of errors.New(emptyDataStructureMessage("stack")) use an
emptyDataError type, where it implements the error interface by adding an
Error() string method, for example:

type emptyDataError string

func (e emptyDataError) Error() string {
return fmt.Sprintf("not empty %s expected", name)
}

Don't ignore errors like you have here as that can lead to
unexpected behavior, in your case a panic if you use those methods..
pushCommand, _ := 


On Sun, 3 Mar 2024 at 21:25, Miss Adorable 
wrote:

> Hi! I wrote
> 
> my first data structure in Go. I wonder how idiomatic my code is to enhance
> it. Previously, I had C# and Java experience.
>
>
> --
> 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/34b9d900-7571-45d1-ae75-21a021d4c75fn%40googlegroups.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/CAA38peYisEwEsTdm-8pB8UmuxaDA6rbxn2DPpSSMdvUXP1%2B7Gg%40mail.gmail.com.


Re: [go-nuts] GO111MODULE=off go get deprecated?

2024-03-03 Thread Jeffery Carr
I guess this boils down to:

GO111MODULE=off go get go.uber.org/zap

used to git clone into ~/go/src/go.uber.org/zap

How am I supposed to do that now? I assume I'm not expected to parse the 
HTML for the go-import and go-source lines!

jcarr

-- 
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/41de28be-a36b-4c2e-8daa-3bbf55cb5b3en%40googlegroups.com.


Re: [go-nuts] Enums, Go1 and proposals

2024-03-03 Thread Mike Schinkel
I have recently seen many are complaining about a lack of enums in Go.  But 
while there are many ways in which I would like to see Go improved, enums 
barely even rank on my list of priorities.

The majority of my experience prior to Go was with dynamic languages that did 
not have explicit enums, and in working with Go I never really felt that enum 
functionality was missing.

That said, what am I missing?  What it is about enums that have so many people 
clamoring for them in Go?  Is it having a textual representation managed by the 
compiler that a go:generate cannot solve?  Is it having a syntax that allows 
treating them like an object with a property, e.g. HttpStatuses.NotFound that 
otherwise requires too much boilerplate?  Or is it something else?

Further, what can you envision doing with a "proper" enum that you cannot 
already do with a custom-typed constant?

Thank you in advance to whoever helps me understand why enums are such as 
burning desire for so many developers.

-Mike

> On Mar 3, 2024, at 12:25 AM, Nicolas Serna  
> wrote:
> 
> Hello, gophers. Lately I've been working quite a bit with enums as I'm moving 
> a C program I had tGo, so I wondered if there was any progress on enums 
> proposals and realized that none of them get anywhere without breaking the 
> Go1 compatibility.
> 
> I've decided to get a bit creative and share with you the proposals I've 
> thought of. 
> 
> The fundamental thing when we talk about the incorporation of "robust enums" 
> is, similarly to the case of generics, to propose a syntax extension to the 
> language without breaking compatibility with the previous software.
> 
> We use enumerations simply to handle states and encapsulate them under a 
> name. Therefore I wanted to propose the following syntax:
> 
> ```proposal
> const ()   = 
> ```
> 
> The idea of this syntax is that, roughly speaking, it reminds us of what we 
> do when we declare a method, with the only difference that in this case we 
> use constant values associated to some "enum type". Then, we should be able 
> to call our constants as follows: ., the same would 
> be true for an already instantiated type.
> 
> ```example
> type Statement struct{ /* ... */ } 
> 
> type StatementTyp int 
> 
> const (Statement) (
>  Prepared StatementTyp = iota
>  Success
>  Fail
> )
> 
> func main() {
> stmt := Statement{}
> fmt.Println(Statement.Prepared) // 0
> fmt.Println(stmt.Success) // 1
> }
> ```
> 
> Realistically speaking this doesn't solve much. It just gives us a way to 
> encapsulate constants in an "elegant" way and keeps the "const-iota" syntax, 
> but little else.
> 
> I think it is essential to have an extra way to reference these internal 
> values of a type so that we can work with the help of the go-typechecker. For 
> this I could only come up with two types of syntax, let's see:
> 
> ```prop1
> var bar const 
> 
> func foo(arg const ) {...}
> ```
> ```prop2
> var foo .const
> 
> func bar(arg .const)
> ```
> 
> That would be all, I hope you can give some feedback and know what you think. 
> I read in the go2-language-template 
>  that 
> it was better to post my ideas in this group instead of making a issue.
> 
> Thanks for reading ^^
> 
> 
> -- 
> 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/134fd31b-9081-4d22-b098-412244338fc5n%40googlegroups.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/39D18DF3-2832-4905-979D-83B83CE06D68%40newclarity.net.


Re: [go-nuts] GO111MODULE=off go get deprecated?

2024-03-03 Thread 'Christian Stewart' via golang-nuts
Hi Jeffery,

You can build large projects with many repos using Go modules.

Firstly, you can reference the other repos and use the latest "master"
version by writing "master" where the v verson is in the file,
then use "go mod tidy"

Second, you can use "go work" to create a workspace with multiple go
modules in it, so that you can develop with them without having to
constantly update the go.mod versions.

Referencing private repositories can be done with GOPRIVATE:

export GOPRIVATE=github.com/myorg

Also edit your ~/.gitconfig to use ssh for your organization private repos:

[url "ssh://g...@github.com/myorg/"]
insteadOf = https://github.com/myorg/

Hope that helps.
Christian

On Sun, Mar 3, 2024 at 2:16 PM Jeffery Carr  wrote:
>
> I guess this boils down to:
>
> GO111MODULE=off go get go.uber.org/zap
>
> used to git clone into ~/go/src/go.uber.org/zap
>
> How am I supposed to do that now? I assume I'm not expected to parse the HTML 
> for the go-import and go-source lines!
>
> jcarr
>
> --
> 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/41de28be-a36b-4c2e-8daa-3bbf55cb5b3en%40googlegroups.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/CA%2Bh8R2qu2fWvv2fD-xHuGb9c92uYyKYu9u6Ub%3DMECVNDY7d8tw%40mail.gmail.com.


Re: [go-nuts] GO111MODULE=off go get deprecated?

2024-03-03 Thread Jeffery Carr
I don't think I understand you.

How can I download go.uber.org/zap sources? I need to be able to do it 
using the "go" binary. I was able to do it before, now I can't. Is there 
some way to do 

go download go.uber.org/zap and have it git clone?

I don't know how to resolve the git clone path.

-- 
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/b8bee469-741b-43a1-90a0-5c9295ce9628n%40googlegroups.com.


Re: [go-nuts] GO111MODULE=off go get deprecated?

2024-03-03 Thread Jeffery Carr
"You can build large projects with many repos using Go modules. "

Also, I forgot to add, lots of my repos are binaries, so module things 
don't apply. How do I tell someone to download go.wit.com/apps/helloworld? 
I can't now with a single GO111MODULE=off go get. Can we have 'go download' 
or can go get be reverted to the prior behavior. I don't understand what is 
wrong with the way things worked before. Does it break something for 
someone?

jcarr

-- 
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/94e6ddac-d745-43d0-8861-20107847cf18n%40googlegroups.com.


Re: [go-nuts] GO111MODULE=off go get deprecated?

2024-03-03 Thread Kurtis Rader
On Sun, Mar 3, 2024 at 5:05 PM Jeffery Carr  wrote:

> "You can build large projects with many repos using Go modules. "
>
> Also, I forgot to add, lots of my repos are binaries, so module things
> don't apply. How do I tell someone to download go.wit.com/apps/helloworld?
> I can't now with a single GO111MODULE=off go get. Can we have 'go download'
> or can go get be reverted to the prior behavior. I don't understand what is
> wrong with the way things worked before. Does it break something for
> someone?
>

> git clone https://git.wit.org/gui/helloworld
Cloning into 'helloworld'...
remote: Enumerating objects: 55, done.
remote: Counting objects: 100% (55/55), done.
remote: Compressing objects: 100% (53/53), done.
remote: Total 55 (delta 23), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (55/55), 18.66 KiB | 398.00 KiB/s, done.
Resolving deltas: 100% (23/23), done.
> ls helloworld
LICENSE  Makefile  debugger.go  main.go

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

-- 
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/CABx2%3DD-iXd-wTZwtrFAUZH%3DP7bJt7egT9S7ux2Vz6D6xzBMCeA%40mail.gmail.com.


Re: [go-nuts] GO111MODULE=off go get deprecated?

2024-03-03 Thread Jeffery Carr
Yes, I do understand the go-source/go-import part, but  am I missing 
something? I don't understand how you would find the go-source other than 
parsing the HTML 

I mean 'go get' used to do that for me, do I now have to write a program to 
do that? I don't understand why that is some bad idea. Yes, we can look at 
the curl output, but I need it to be programatic (I have lots of these 
repos so typing them in by hand is not really an option).

Thanks,
jcarr

-- 
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/22444265-8720-4917-968c-2ab2fd3961e9n%40googlegroups.com.


Re: [go-nuts] Adding context.Context as first parameter in every function

2024-03-03 Thread 'Yash Bansal' via golang-nuts
@axel Most of the functions I have (except the utility ones) will be 
needing the context parameter, that's why I thought of adding context to 
every function, and just using auto-refactoring to remove context from the 
functions which doesn't use it.

@Sam Thanks for providing me with your repo link. Will go through it for 
sure. Sadly, I have started manually editing every function to add the 
parameter now. Let's hope the go-devs address my problem.


On Friday, March 1, 2024 at 11:07:34 PM UTC+5:30 Sam Vilain wrote:

> Hi Yash, unfortunately that's the only approach at the moment.
>
> Your request is very apropos of my thread, "Could we trade all the `ctx 
> context.Context` arguments for one pointer in `g`?".  This is the exact use 
> case I have in mind.  I believe it should be possible, and even a fairly 
> naïve implementation should not slow down code that does not use the 
> context variables at all.
>
> I have a proposal in draft at: https://github.com/samv/go-context-proposal
>
> Cheers,
> Sam
>
>
> On 3/1/24 12:40 AM, 'Yash Bansal' via golang-nuts wrote:
>
> Hello, 
>
> I recently started writing code in Golang and wasn't aware that unlike 
> Java, we can't use ThreadLocals to propagate a context across the code. 
> It's mandatory to explicitly pass a context. I have already written a 
> service which is live in production now, however for monitoring and other 
> reasons, I need to pass the context argument to every function. 
>
> *ASK *
> Is there a tool or library which can help me do the same, instead of me 
> going to every function and it's caller and adding the context field?
>
> I have been following this thread - 
> https://groups.google.com/g/golang-nuts/c/ti8M-fuu6RE/m/8w3LA1dXAwAJ
> But looks like people in this thread have abandoned the idea of making a 
> library like this.
>
> Any leads would be appreciated. 
>
>
>
>
> *::DISCLAIMER:: 
> 
>  
> The contents of this e-mail and any attachments are confidential and 
> intended for the named recipient(s) only.E-mail transmission is not 
> guaranteed to be secure or error-free as information could be intercepted, 
> corrupted,lost, destroyed, arrive late or incomplete, or may contain 
> viruses in transmission. The e mail and its contents(with or without 
> referred errors) shall therefore not attach any liability on the originator 
> or redBus.com. Views or opinions, if any, presented in this email are 
> solely those of the author and may not necessarily reflect the views or 
> opinions of redBus.com. Any form of reproduction, dissemination, copying, 
> disclosure, modification,distribution and / or publication of this message 
> without the prior written consent of authorized representative of redbus. 
> com is strictly prohibited. If you have received this 
> email in error please delete it and notify the sender immediately.Before 
> opening any email and/or attachments, please check them for viruses and 
> other defects.* -- 
>
> 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...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/58b07900-05cf-4550-b069-96c6d4cc3614n%40googlegroups.com
>  
> 
> .
>
> -- 
> Sam
>
>
-- 
*::DISCLAIMER::


The contents of this e-mail and any attachments are confidential and 
intended for the named recipient(s) only.E-mail transmission is not 
guaranteed to be secure or error-free as information could be intercepted, 
corrupted,lost, destroyed, arrive late or incomplete, or may contain 
viruses in transmission. The e mail and its contents(with or without 
referred errors) shall therefore not attach any liability on the originator 
or redBus.com. Views or opinions, if any, presented in this email are 
solely those of the author and may not necessarily reflect the views or 
opinions of redBus.com. Any form of reproduction, dissemination, copying, 
disclosure, modification,distribution and / or publication of this message 
without the prior written consent of authorized representative of redbus. 
com is strictly prohibited. If you have received this 
email in error please delete it and notify the sender immediately.Before 
opening any email and/or attachments, please check them for viruses and 
other defects.*

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this g