[go-nuts] Re: [ANN] templatecheck: type-checking Go templates

2021-01-10 Thread Amnon
This is really cool! The world of templates has always been a frightening departure from the type-safety of Go to the wild world of dynamically typed languages, where run-time errors hid in every code path. templatecheck helps eliminate a large class of hard-to-find errors. Thanks for writin

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

2021-01-10 Thread 'JOE MCGUCKIN' via golang-nuts
OK, I was doing everything in the ~/go directory. I assumed that 'go get’ would create the appropriate directories under go/src. I have not followed your example yet, but I suspect that’s my problem. Thanks! Joe > On Jan 10, 2021, at 5:24 PM, Rick wrote: > > I'm not entirely following wh

[go-nuts] Re: Golang vs Python: Complete Comparison with their Top Frameworks

2021-01-10 Thread nikolay nikolay
I would expected to see at these two things: 1. That most of the serious solutions in "Python" are actually wrappers for highly optimized machinery in C/C++. If you look at just basic ML stack: Pytorch, Tensorflow, OpenCV, numpy, scipy, XGBoost, so on. all is in C/C++ with wrapper in Python. 2.

Re: [go-nuts] Golang vs Python: Complete Comparison with their Top Frameworks

2021-01-10 Thread Wendell Hatcher
Python and Golang really can't be compared as python is just a cleaned up prettier cousin of Perl. Golang is a compiled language really more enterprise and full application build ready. It would be better if Golang was compared to C#,Java or C++ as it is a full language not a scripting one. Hell co

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

2021-01-10 Thread Rick
I'm not entirely following what you are doing. But here are some comments. You have a directory $HOME/go, the contents of which look like what you would see under $GOPATH. If you are going to create a project under $HOME/go (whether GOPATH is defined or not), the suggested place to put it is in

[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

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] [ANN] templatecheck: type-checking Go templates

2021-01-10 Thread Jonathan Amsterdam
The github.com/jba/templatecheck package[0] can validate field references and other operations of a text/template or html/template in tests or during program startup. It also works for github.com/google/safehtml/template[1]. [0] https://pkg.go.dev/github.com/jba/templatecheck [1] https://pkg.go

Re: [go-nuts] Do I need to hold a lock of a struct to read the member concurrently?

2021-01-10 Thread 김용빈
Haha, thanks. I didn't feel get pushed. :) 2021년 1월 10일 일요일 오후 9시 36분 39초 UTC+9에 axel.wa...@googlemail.com님이 작성: > On Sun, Jan 10, 2021 at 12:57 PM 김용빈 wrote: > >> Thank you Wagner, as always! >> >> Yes, I asked because it is a field of a struct. With your answer, now I >> can sure what I wrote

Re: [go-nuts] Do I need to hold a lock of a struct to read the member concurrently?

2021-01-10 Thread 'Axel Wagner' via golang-nuts
On Sun, Jan 10, 2021 at 12:57 PM 김용빈 wrote: > Thank you Wagner, as always! > > Yes, I asked because it is a field of a struct. With your answer, now I > can sure what I wrote is correct or not. > > And also thanks for your guide to official documents. I will check them > first next time. > No wo

Re: [go-nuts] Do I need to hold a lock of a struct to read the member concurrently?

2021-01-10 Thread 김용빈
Thank you Wagner, as always! Yes, I asked because it is a field of a struct. With your answer, now I can sure what I wrote is correct or not. And also thanks for your guide to official documents. I will check them first next time. 2021년 1월 10일 일요일 오후 6시 53분 29초 UTC+9에 axel.wa...@googlemail.co

Re: [go-nuts] Do I need to hold a lock of a struct to read the member concurrently?

2021-01-10 Thread 'Axel Wagner' via golang-nuts
Short answer: Yes, it's safe. IMO it's always fun to try and find the answer in the docs though, so long answer: According to the Go memory model The Go memory model specifies the conditions under which reads of a > variable in one goroutine can be guaranteed t

[go-nuts] Do I need to hold a lock of a struct to read the member concurrently?

2021-01-10 Thread 김용빈
I have a struct that will be used concurrently. type A struct { sync.Mutex id string // other members ... } The other members of A will be concurrently read or written. So I think I have to hold lock of A for those. But A.id will be written once at creation time of A (when it wa