[go-nuts] Unique GO language features

2020-08-21 Thread joseph.p...@gmail.com
I really like the 'defer' statement and think it would be a useful addition to other programming languages. The feature where GO performs escape analysis and promotes stack variables to the heap: Did that originate with GO or was it first implemented elsewhere? Thanks, Joe -- You received t

[go-nuts] Thread safe tree library?

2021-01-05 Thread joseph.p...@gmail.com
Is there a simple tree library that is thread safe? If I have to write one for myself, do I have to set locks on nodes as I walk the tree to prevent another thread from changing nodes that are 'above' me? -- You received this message because you are subscribed to the Google Groups "golang-nu

Re: [go-nuts] Thread safe tree library?

2021-01-05 Thread joseph.p...@gmail.com
Well, I think I only need to lock on writes, and it'll be easier if I just lock the entire tree on writes. Reads will be the majority of the operations by far. This is for a bit of caching before we go to a K/V database like REDIS, etc. On Tuesday, January 5, 2021 at 5:16:36 PM UTC-8 k.alex...@

Re: [go-nuts] Thread safe tree library?

2021-01-10 Thread joseph.p...@gmail.com
Thanks! You all have given me much to look at. -joe On Friday, January 8, 2021 at 2:56:46 PM UTC-8 k.alex...@gmail.com wrote: > I was thinking of potential issues if you rebalance the tree as an example. >> >> I’m not certain what issues could arise as I’ve never considered a >> concurrent data

[go-nuts] $GOPATH/go.mod exists but should not

2021-01-10 Thread joseph.p...@gmail.com
I found (what I think is) a simple GO project to play with as a learning exercise: https://intersog.com/blog/how-to-write-a-custom-url-shortener-using-golang-and-redis/ The second step fails immediately. with the aforementioned error message. I'm using GO version 1.15.6 $GOPATH is unde

[go-nuts] Packages vs methods

2023-04-03 Thread joseph.p...@gmail.com
When I’m reading go source and I see something like foo.bar(), my brain stutters for a second while I’m trying to determine if this is a reference to a package function or a receiver/method. Is there an easy way to make this determination? Thanks -- You received this message because you are s

[go-nuts] Home directory?

2023-04-23 Thread joseph.p...@gmail.com
In the ‘Create a Go Module’ documentation, it keeps referencing ‘home directory’ and uses the unix command ‘cd’. Do they literally mean my unix home directory or do they mean my GOPATH directory? Have GOPATH and GOROOT been deprecated? Thanks, Hoe -- You received this message because you ar

[go-nuts] Go modules question

2023-08-16 Thread joseph.p...@gmail.com
I’m reading a GO book for beginners. They’re always naming their module in the form: github.com/username/program Is the ‘github.com’ portion of the module name mandatory? I really have no intention of saving my code to github. If i’m saving my code locally, can i use an arbitrary module name

[go-nuts] templates not working for me

2024-02-03 Thread joseph.p...@gmail.com
I'm goofing around with GIN and trying some examples. I can't get templating to work for me. File inclusion works, but variable substitution does not. GOLANG version 1.20.12 package main import "github.com/gin-gonic/gin" import "net/http" // import "gorm.io/driver/sqlite" // import "gorm.i

[go-nuts] Re: templates not working for me

2024-02-07 Thread joseph.p...@gmail.com
Ok, Variable substitution doesn't seem to work in an included template file. Is that a known limitation? On Saturday, February 3, 2024 at 11:40:40 PM UTC-8 joseph.p...@gmail.com wrote: > I'm goofing around with GIN and trying some examples. I can't get > templating to