[go-nuts] Re: go list fails, how do I clear "-mod=readonly"

2023-10-17 Thread Pat Farrell
been released. Go 1.21 was released in > August and there have been 5 point releases to 1.20 since your version > (1.20.5) was released. Have you tried updating your Go toolchain? > > On Monday, October 16, 2023 at 4:21:11 PM UTC-4 Pat Farrell wrote: > >> yes that is it. >>

[go-nuts] Re: go list fails, how do I clear "-mod=readonly"

2023-10-16 Thread Pat Farrell
yes that is it. I see that there is a patch that will be in the next release. Anyone know of a workaround until then? thanks -- 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

[go-nuts] Re: go list fails, how do I clear "-mod=readonly"

2023-10-16 Thread Pat Farrell
On Monday, October 16, 2023 at 1:22:42 PM UTC-4 TheDiveO wrote: go mod tidy I've done that, and while it just executes quietly, I don't see how that addresses the issue that 'go list' fails to show me modules that have been updated. thanks pat -- You received this message because you are sub

[go-nuts] go list fails, how do I clear "-mod=readonly"

2023-10-16 Thread Pat Farrell
i'm running go version go1.20.5 linux/amd64 when I attempt to run 'go list' to find any updated to dependant modules, it fails. go list -m -u all go: updates to go.sum needed, disabled by -mod=readonly I've checked, and my go.mod and go.sum files are 777 -rwxrwxrwx 1 pfarrell pfarrell 408 Oct

[go-nuts] Best practice for "main.go" to access members of a structure in the real package

2023-02-17 Thread Pat Farrell
I'm still struggling with how to setup my access. I'm building a library, say tagtool and it has a nice clean subdirectory with the files that make up the go package, each with package tagtool And I have a subdirectory called "cmd" that contains a near trivial main.go that calls the various

Re: [go-nuts] Re: Why can't a regexp.Regexp be const

2023-02-16 Thread Pat Farrell
Yes of course. At least your version is easier for humans to read. In the application, I expect the whole regexp thing is trivially small part of the execution process. But I'm trying to write proper idiomatic go, and yours is nicer -- You received this message because you are subscribed to th

Re: [go-nuts] Why can't a regexp.Regexp be const

2023-02-13 Thread Pat Farrell
On Monday, February 13, 2023 at 7:08:35 PM UTC-5 David Finkel wrote: So, why can't the regexp be a constant? Only primitive types are allowed to be constant in go Oh, this is what I missed. For cases like this, I tend to create an unexported package variable

[go-nuts] Why can't a regexp.Regexp be const

2023-02-13 Thread Pat Farrell
This won't compile var ExtRegex = regexp.MustCompile("(M|m)(p|P)(3|4))|((F|f)(L|l)(A|a)(C|c))$") with a ./prog.go:10:18: regexp.MustCompile("((M|m)(p|P)(3|4))|((F|f)(L|l)(A|a)(C|c))$") (value of type *regexp.Regexp) is not constant while const pat = "((M|m)(p|P)(3|4))|((F|f)(L|l)(A|a)(C|c))$

Re: [go-nuts] recommendations please: go source level debugger for linux

2023-02-04 Thread Pat Farrell
On Thursday, February 2, 2023 at 10:49:40 PM UTC-5 Ian Lance Taylor wrote: Have you tried Delve? https://github.com/go-delve/delve Thanks I will check into it. One point about go and PMD, because the compile time is so fast, using PMD is not nearly as painful as it would be in other languages tha

[go-nuts] recommendations please: go source level debugger for linux

2023-02-02 Thread Pat Farrell
I've been using PMD to debug my go code since I started. (PMD => Poor Man's Debugger, i.e fmt.Printf statements) and it was OK for my initial simple stuff. But as I am writing more complex code, I think its time to find a nice source level debugger. Any recommendations? I guess I could use an IDE

Re: [go-nuts] Simple Regexp fails but more complex one finds match

2023-01-19 Thread Pat Farrell
That's it. Thanks a ton -- 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

[go-nuts] Simple Regexp fails but more complex one finds match

2023-01-19 Thread Pat Farrell
This has to be something simple, but I've been pulling my hair out for days. I have made two regexp.MustCompile where one is just a simple punctuation search and the other is a combination of an identifier plus the punctuation search. I am building the patterns with two strings that I concatinate

Re: [go-nuts] when doing a WalkDir of a FileSystem, how do you get access to the path that you are working on

2023-01-14 Thread Pat Farrell
On Saturday, January 14, 2023 at 6:52:15 PM UTC-5 raf wrote: The function you implement (WalkDirFunc should receive "p" as the path to the parent (that seems to be what you want) and "d" as the current directory entry. I am not sure why in your example you are showing full paths to the file f

[go-nuts] when doing a WalkDir of a FileSystem, how do you get access to the path that you are working on

2023-01-14 Thread Pat Farrell
I'm using the reasonably new FileSystem style to do the usual directory walk processing every file in the usual recursive manner. I can't figure out how to get the directory data (the path up to the last /) even though I can see it in the output. I am missing the proper name of the getter, or perh

[go-nuts] Re: How to read system login password from golanguage

2020-06-02 Thread Pat Farrell
On Tuesday, June 2, 2020 at 12:38:46 PM UTC-4, poorni...@gmail.com wrote: > > How to read system login password in go language You can't on most reasonably modern systems -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

[go-nuts] Re: Any solution to hide my source code written in Go and make it a library to develop in Go as well

2020-05-17 Thread Pat Farrell
Write your code as a service, run it on a cloud service and have the customers just use normal HTTP(s) You will regret any silly obfuscation approach -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiv

[go-nuts] Re: keep just 2 decimal places in a float64

2020-01-26 Thread Pat Farrell
never use floating point if you are trying to represent money, say dollars and cents or decimal values of the euro. Store the money as integer number of pennies. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and

Re: [go-nuts] tricks for installing go a single time on Windows 10 with Bash for Windows

2019-12-05 Thread Pat Farrell
On Thursday, December 5, 2019 at 12:27:20 PM UTC-5, Rodrick Brown wrote: > > The first thing > Thanks. But that was not what I was asking for. I have the shells working. But go's installation has a lot of config stuff that needs to be setup. I want to have go work the same no matter which shell

[go-nuts] tricks for installing go a single time on Windows 10 with Bash for Windows

2019-12-04 Thread Pat Farrell
I've got a new machine. I run Windows 10, but use bash all the time for all my command line stuff, and running vim, etc. When I did it on the prior machine, it was a fairly large pain to get go to work properly in all the environments, the special go shell, PowerShell, bash, etc. I'd like to do

[go-nuts] Re: P-local/M-local storage for goroutines?

2019-07-23 Thread Pat Farrell
On Tuesday, July 23, 2019 at 1:22:09 PM UTC-4, Zihan Yang wrote: > > I am trying to implement an LRU cache. > Don't use an LRU, use a working set cache. Proven to be better back in 1969 by Peter J Denning. -- You received this message because you are subscribed to the Google Groups "golan

[go-nuts] Re: prevent alteration of binaries once distributed in the wild?

2019-07-23 Thread Pat Farrell
On Tuesday, July 23, 2019 at 2:51:27 PM UTC-4, clement auger wrote: > > I m looking for a technique to prevent binary alteration once distributed > in the wild. > This is impossible. You can make it harder, you can detect it, but as long as we use a Von Neumann architecture, executable code is

[go-nuts] Re: Interesting public commentary on Go...

2019-05-23 Thread Pat Farrell
On Thursday, May 23, 2019 at 9:18:25 AM UTC-4, lgo...@gmail.com wrote: > > https://utcc.utoronto.ca/~cks/space/blog/programming/GoIsGooglesLanguage > Before I became a GO nut, I did 20 years of commercial Java. I became a big fan of Google's Guava library. Guava was open source, but was driven by

Re: [go-nuts] is -2147483648 the same as MinInt32

2019-04-21 Thread Pat Farrell
On Sunday, April 21, 2019 at 11:50:38 PM UTC-4, Kurtis Rader wrote: > > On Sun, Apr 21, 2019 at 8:37 PM Pat Farrell > wrote: > >> I have a logic error in my calculation. I am getting -2147483648 in an >> int32 >> >> A 2s-complement 32-bit int b

[go-nuts] Re: is -2147483648 the same as MinInt32

2019-04-21 Thread Pat Farrell
Thanks to all. I speak Linux and sadly Winders 10 these days. I do have a MacBookPro that I got for IOS development years ago, but its old and way too slow. My fundamental problem was a NaN. Added a check and all is fine. Thanks -- You received this message because you are subscribed to the Go

[go-nuts] is -2147483648 the same as MinInt32

2019-04-21 Thread Pat Farrell
I have a logic error in my calculation. I am getting -2147483648 in an int32 This sure looks a lot like MinInt32, but I can't seem to be able to tell, all my calculators want to blow up on -1 << 31 I'm willing to bet that my value is +/- one from whatever MinInt32 is in decimal form. Is this c

[go-nuts] Re: Decimal survey

2019-03-28 Thread Pat Farrell
On Thursday, March 28, 2019 at 2:41:26 PM UTC-4, Daniel Theophanes wrote: > > If you represent decimals or money in Go, I'd like to hear from you: > > https://docs.google.com/forms/d/e/1FAIpQLScqXYCCCS4fTJXnRvB0qDWsbDXFL9tBBtwDY4y3Ym953nq5MQ/viewform > > I work on database/sql and a few sql drive

[go-nuts] commercial (?) password manager written in go (like lastpass, dashlane, etc.)

2019-02-26 Thread Pat Farrell
I've been reading the group for a long time, and have vague memories that someone from a company responded to a technical question posted with a nice answer and as an aside, mentioned that he worked for a company that used go to create a commercial password manager, using go's multi-platform and

[go-nuts] Re: The performance comparation of Golang and Java

2019-01-24 Thread Pat Farrell
On Thursday, January 24, 2019 at 9:21:14 PM UTC-5, Topget wrote: > > I have tested several simple functions with Golang and Java. To my > surprise, Java sometimes is faster than Golang(especially in recursive > function and some function in standard library such as math/rand.Rand). > What other

[go-nuts] Re: GO lang not able to decrypt the xor-base64 text

2019-01-20 Thread Pat Farrell
On Sunday, January 20, 2019 at 10:14:05 AM UTC-5, Soorya Prakash wrote: > > > I am using the below code to encrypt and decrypt the data. Now I want to > encrypt the data from Node JS and want to decrypt the data from Go lang. > use -1 as the key to debug. once that works, use zero as the key.

[go-nuts] Re: Secure password hashing algorithm in go.

2019-01-07 Thread Pat Farrell
On Friday, December 4, 2015 at 5:33:45 PM UTC-5, Jeff wrote: > > > "My question for the original poster is whether he needs to maintain > compatibility with a legacy system, or whether he is looking for a good > system when starting from scratch." > > it will be a new system that will import exi

Re: [go-nuts] go for robotic control, walking balance, quad flight control

2019-01-02 Thread Pat Farrell
On Wednesday, January 2, 2019 at 7:23:49 PM UTC-5, Wim Lewis wrote: > > Go's GC pauses and Linux's preemptions make them bad choices for this if > occasional random failures are unacceptable, but in practice, for tinkering > purposes, I think they're both fine --- That is my current thinking,

[go-nuts] Re: How to inplement C# DESCryptoServiceProvider in Go Lang?

2019-01-01 Thread Pat Farrell
On Saturday, October 3, 2015 at 1:38:18 PM UTC-4, Tuan Hoang Anh wrote: > > Hello. How to inplement C# DESCryptoServiceProvider in Go Lang? I have > Decrypt in C# and want Encrypt in go lang. > Can I ask a fundamental question: Why is anyone in 2019 trying to implement DES? While it was made a

Re: [go-nuts] Re: go for robotic control, walking balance, quad flight control

2019-01-01 Thread Pat Farrell
On Tuesday, January 1, 2019 at 6:07:03 PM UTC-5, robert engels wrote: > > Wouldn’t you wrap the slices custom structs with a domain specific > interface? You can create whatever notation is needed... > Perhaps I'm naive but I was expecting that a two dimensional metric of quaternions would be

[go-nuts] Re: go for robotic control, walking balance, quad flight control

2019-01-01 Thread Pat Farrell
On Monday, December 31, 2018 at 4:19:50 PM UTC-5, minf...@arcor.de wrote: > > So perhaps you should saddle your horse backwards, and then decide if > Golang as front-end development language > is really the right choice for you. And then Golang doesn't treat complex > matrix algebra well... > > A

[go-nuts] go for robotic control, walking balance, quad flight control

2018-12-29 Thread Pat Farrell
I need a project to motivate myself into writing some non-trivial go. So I want to learn about implementing control theory, sensors, etc. Things like IMU (gyro, 3D magnetic compass, and accelerometer) GPS. Not only do I want to talk to the sensors, but I want to implement Kalman filters, PID co

[go-nuts] Re: Do you need a web framework for Go?

2018-12-27 Thread Pat Farrell
On Thursday, December 27, 2018 at 11:43:51 AM UTC-5, Tushar Soni wrote: > > I recently wrote a discussion article on using stdlib for developing web > applications vs. using web frameworks. It points some pain points and goes > on to provide a solution. > I tend to hate, hate hate the massive

[go-nuts] go language sensitive editor?

2018-11-20 Thread Pat Farrell
I know, this is both a FAQ and an unanswerable question. I'm an old programmer who has used nearly every editor known to man. I am not a fan of whole-universe IDEs, but can use them. I also speak vi/vim pretty fluently. What editors do folks use for go? I'd like something that can complete func

Re: [go-nuts] Re: Go 2 Proposal Comments

2018-10-27 Thread Pat Farrell
On Friday, October 26, 2018 at 11:32:10 PM UTC-4, Robert Engels wrote: > > First, there is simply no debate, Java += Android, and you have the most > successful language/platform ever. NO debate. > Er, I can argue that VisualBasic + Windows is the most successfull but I have no dog in that hun

[go-nuts] Re: Go 2 Proposal Comments

2018-10-26 Thread Pat Farrell
On Wednesday, October 24, 2018 at 11:59:34 AM UTC-4, robert engels wrote: > > When Java came along there was a heavy sigh of relief by ISVs that > understood write-once, and it will continue to work even as mega company > released new OS versions and APIs - the burden was on the JDK/JRE > impl

Re: [go-nuts] GO lang implementation for one deck card shuffle

2018-08-15 Thread Pat Farrell
On Thursday, August 16, 2018 at 12:51:19 AM UTC-4, Rob 'Commander' Pike wrote: > > The math/rand package has 38848 bits of state. The seed value is only 64 > bits, yes, but that's a separate question. Is seeding what you are > concerned with? > Oh, that is good news. I didn't see that in the

[go-nuts] GO lang implementation for one deck card shuffle

2018-08-15 Thread Pat Farrell
I want to build a poker simulator. For this, I need a nice method to shuffle cards. A bit of googling shows that a good basic approach is the Fisher-Yates shuffle. Its O(n) and space efficient. But it depends on the quality of the PRNG. I am specifically concerned that the math/rand is only 64

Re: [go-nuts] Re: Web Framework for Beginners

2018-01-27 Thread Pat Farrell
On Saturday, January 27, 2018 at 4:34:39 PM UTC-5, Lars Seipel wrote: > > We're talking about a beginning Go programmer that has yet to learn how > some of the more advanced parts of the language fit together properly. Sorry, no. Folks coming from other languages want to know how to do the u

[go-nuts] Re: Web Framework for Beginners

2018-01-27 Thread Pat Farrell
On Thursday, January 25, 2018 at 8:38:01 PM UTC-5, matthe...@gmail.com wrote: > > Specific question: how do you handle the user hitting the "back" button on >> their browser? Its very common and a lot of simple approaches don't handle >> it well. > > > This was a problem for me. I force the pa

[go-nuts] Re: Web Framework for Beginners

2018-01-25 Thread Pat Farrell
On Thursday, January 25, 2018 at 8:36:29 AM UTC-5, matthe...@gmail.com wrote: > > Here’s a third vote for the standard library. > https://golang.org/pkg/net/http/ + https://golang.org/pkg/html/template/ > are already effectively a web framework. > OK, I know this is a frequent answer, just use

[go-nuts] Re: First time building a rest-api-based web app: general security-related questions

2018-01-25 Thread Pat Farrell
On Thursday, January 25, 2018 at 8:33:40 AM UTC-5, matthe...@gmail.com wrote: > > > (2) would using a session cookie + some authorization middleware (such > as casbin) make sense for our situation? what are its pro's and con's? > > This is what I'm familiar with. The main con is having to check

[go-nuts] Re: First time building a rest-api-based web app: general security-related questions

2018-01-24 Thread Pat Farrell
The first answer depends on more questions to language independent requirements such as: 1) are you using TLS/HTTPS for first tier traffic protection? 2) what threat model do you have (what threats do you worry about? what do you deliberately ignore? Who are the bad guys? 3) How valuable is the

[go-nuts] Re: Any plans to add ASN.1 PER support?

2018-01-11 Thread Pat Farrell
On Thursday, January 11, 2018 at 10:50:24 AM UTC-5, David Wahlstedt wrote: > > I wonder if there are any plans to add PER encoding/decoding support for > ASN.1? > I have looked around, and it seems that there isn't any project supporting > this, currently. > Wow, I haven't heard anyone ask for A

[go-nuts] Micali 'algorand' in go?

2018-01-10 Thread Pat Farrell
Anyone working on this? Would seem to be a natural thing to implement in go. He has published papers talking about a C++ implementation, but I've done more than enough C++ in my lifetime. If there is no existing effort, is there any interest in joining me in one? -- You received this message b

Re: [go-nuts] Re: go on Windows 10 from the bash shell (and the cmd shell)

2017-10-12 Thread Pat Farrell
On Thursday, October 12, 2017 at 8:31:52 PM UTC-4, Gerald wrote: > > The MSI is a Windows application, whereas apt-get would install the > Linux binary of go. > > WSL has you actually running Linux binaries on Windows unless you > specifically go and choose a Windows executable. > The MSI fil

Re: [go-nuts] Re: go on Windows 10 from the bash shell (and the cmd shell)

2017-10-11 Thread Pat Farrell
On Wed, Oct 11, 2017 at 11:32 PM, wrote: > Did you install the Windows or Linux go binary distribution? > I went to the distribution site and installed the .msi file like any windows installation I've been running bash since about 1987, so I'm partial to it. Other than the file names, I'm not

[go-nuts] Re: go on Windows 10 from the bash shell (and the cmd shell)

2017-10-11 Thread Pat Farrell
I found how to force 'go build' to work under the bash shell on Winderz you have to add a symlink in the program directory containing go.exe such as ln -s go.exe go On Wednesday, October 11, 2017 at 7:59:04 PM UTC-4, brainman wrote: > > On Thursday, 12 October 2017 09:2

[go-nuts] Re: go on Windows 10 from the bash shell (and the cmd shell)

2017-10-11 Thread Pat Farrell
On Wednesday, October 11, 2017 at 6:08:26 PM UTC-4, brainman wrote: > > > On Thursday, 12 October 2017 02:34:49 UTC+11, Pat Farrell wrote: > > https://golang.org/doc/install > > This one says "... Next, make the directory src/hello inside your > workspace ..."

[go-nuts] Re: go on Windows 10 from the bash shell (and the cmd shell)

2017-10-11 Thread Pat Farrell
On Wednesday, October 11, 2017 at 4:12:45 AM UTC-4, brainman wrote: > > > On Wednesday, 11 October 2017 16:04:28 UTC+11, Pat Farrell wrote: > > 1) is the standard documentation wrong/out of date? > > What documentation are you referring to? Did you read > https://

[go-nuts] go on Windows 10 from the bash shell (and the cmd shell)

2017-10-10 Thread Pat Farrell
I've installed the go 1.9 binary distribution on my windows 10 laptop. I just let the install do the defaults. (in addition to learning go, I'm trying to see if I can live with bash under Windows, or if I have to reboot to a linux distro to avoid going crazy, that is a separate topic) in the c