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

2023-10-17 Thread Pat Farrell
yes, thanks
I updated to the latest go and no longer get the error

I'm not sure I understand the output that I'm getting now, but that
is a subject for more research on my par
On Monday, October 16, 2023 at 5:12:41 PM UTC-4 Jason Phillips wrote:

> I believe the fixes have already 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.
>>  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 an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/6fec2e17-d3d6-4908-b5eb-6df6ae48a7dan%40googlegroups.com.


[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 an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/1bef2922-a622-4901-9211-bdc13a638efan%40googlegroups.com.


[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 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/93d11a28-06fc-451f-8295-071a3de15041n%40googlegroups.com.


[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  1 10:37 go.mod*
-rwxrwxrwx 1 pfarrell pfarrell 3025 Oct  1 10:37 go.sum*

What am I doing wrong?
How do I get a list of updated modules?

thanks
pat

-- 
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/52bbc732-7f34-42a4-be1f-aebfe261d6d7n%40googlegroups.com.


[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 tagtool.Mumble() func.
So far, so good.

But I've been using file/package level vars. This is clearly a bad thing.
So I'm trying to bundle all the various vars into a struct, and 
I'll have my main.go call a 

func AllocateData() *GlobalVars {
rval := new(GlobalVars)
//.. do other init stuff
return rval
}

This way we have the main holding the storage for what had been 
file/package level
vars.

Which is a good start. It works great if I capitalize all the variables.
But I really don't want to make all of the variables in the struct be part 
of my public API. They are all implementation details. I need to be able to 
initialize various variables in the GlobalVars struct from my 'main.go'

Right now, its mostly flag variables that I need. Stuff like
flag.BoolVar(, "de", false, "debug on")

The main.go doesn't really care about the values once the flag package has 
set them from the shell arguments, it just wants the tagtool 

Is there a "friend" declaration or import that lets the "package main" look 
into
the package tagtool?

Thanks
Pat

-- 
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/d64ccb62-9134-4c66-8fb3-6ce1ffe19871n%40googlegroups.com.


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 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/2f24866b-43e8-4058-8784-aef89cf570c2n%40googlegroups.com.


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 that's 
initialized with MustCompile.
package-level variables are generally bad-form, but there are cases where 
you have mostly-readonly things that must be initialized at startup in 
which they make sense. (constant-initialized regexps are one of these)

Which is why I was trying to not use them or make things const.

Long ago, when dinosaurs roamed, I spent a lot of time trying to use C++'s 
const
in places that made sense. It was a disaster and I gave up.

-- 
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/58c0112c-e797-4b64-aa9c-9826b423bc60n%40googlegroups.com.


[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))$"
var ExtRegex = regexp.MustCompile(pat)

Works fine.
So, why can't the regexp be a constant?
Is there some state that is kept in the regexp.Regexp store?

And perhaps more importantly, what is the proper go style to
have a compiled regexp?
I could put the var statement outside all blocks, so its in effect
a package variable. But I think having package variable is bad form.

I'm using the regexp in a loop for all the strings in all the files in a 
directory tree.
I really don't want to compile them for ever pass thru the lines

Thanks
Pat

-- 
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/39ae6e9f-1c27-45cd-93c2-39a3b75cc6a3n%40googlegroups.com.


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 that have long compile/link times. I know this 
was one of the design
goals way back when go was invented. Sure is neat. 

I've recently discovered how handy it is to stick a "panic()" into the 
code, giving me a very nice stack trace
that has come in handy.

-- 
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/cd3653b0-ac5c-452f-8c29-f2e7f0919bacn%40googlegroups.com.


[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 if that it popular, I'm kinda old
school and just use vim

Thanks
Pat

-- 
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/5f9a909c-ef29-4669-b1bd-b2dd941f03f2n%40googlegroups.com.


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://groups.google.com/d/msgid/golang-nuts/85df35ec-e36e-4dbd-b7e0-4c8b0cc3ac97n%40googlegroups.com.


[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 as argument 
to the MustCompile.

The complex Find works, but the simplier one returns nothing.
This is the opposite of what I expected.

Playground:
https://go.dev/play/p/4gp43BvwRwo

The code is near trivial, 
The output in the playground shows an empty slice when Find is 
called on the punctuation, yet 
returns the expected slice on the more complex pattern:
output:
>< 
Heart - 
Program exited.

Source: 
package main

import (
"fmt"
"regexp"
)

func main() {
var fn = []byte("Heart - Crazy On You")
const nameP = "(([0-9A-Za-z]*)\\s*)*"
const divP = "-*"
var regMulti = regexp.MustCompile(nameP + divP)
var regPunch = regexp.MustCompile(divP)

p := regPunch.Find(fn)
fmt.Printf(">%s<\n", p)

m := regMulti.Find(fn)
fmt.Printf("%s\n", m)
}

Any enlightenment 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/51915214-d52a-431d-aca4-bbdda2b380een%40googlegroups.com.


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 for "p".

I don't know either. But that is what the code is doing. 

-- 
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/4bdfb9e5-be8c-407b-9885-f476e4c7bff2n%40googlegroups.com.


[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 perhaps a cast/type assertion


Playground:
https://go.dev/play/p/Fde-rAA5YZI

The key code is
fsys := os.DirFS(".")
fs.WalkDir(fsys, ".", func(p string, d fs.DirEntry, err error) error {
fmt.Printf("%s  struct: %T  %v\n", p, d, d)

which prints "'p" the current file name and extension
the type of the fs.DirEntry and then the fsDirEntry structure

Something like this:
csvtsd/csvtsd.go  struct: *os.unixDirent  &{../csvtsd csvtsd.go 0 }
csvtsd/csvtsd_test.go  struct: *os.unixDirent  &{../csvtsd csvtsd_test.go 0 
}
csvtsd/go.mod  struct: *os.unixDirent  &{../csvtsd go.mod 0 }

You can see that the "p" is typically the path and filename
csvtsd/csvtsd.go  
the type is a  *os.unixDirent 
and there are four fields in the Dirent, the path (up to the last /)
the filename and extension, and two other fields.

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 an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/99c9d821-be0e-4763-ab40-72e3af61c511n%40googlegroups.com.


[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 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/1216f5b8-d210-479c-9868-4f31652f1698%40googlegroups.com.


[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 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/578430b1-884e-48b0-9f10-c2c1228bde82%40googlegroups.com.


[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 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/cc852ce3-6f88-40fd-8b19-877c76deec10%40googlegroups.com.


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 I am using. Sadly, 
the shells are separate, so things like logical links, paths, etc have to 
be redone for each of them. This is clearly an obvious bugfarm as its easy 
to setup a config say in bash that is different from the cmd.exe or 
powershell config. 

-- 
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/aa2f0011-a75e-4c6e-954a-25f2a9cdca30%40googlegroups.com.


[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 it directly and cleanly this time.

Any tips and tricks I should know about?

-- 
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/9c41b516-60a1-44e8-9b90-9cb5f65c8278%40googlegroups.com.


[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 
"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/9da36ee1-561f-4947-a304-69ea7da00b75%40googlegroups.com.


[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 just data 

-- 
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/46549d08-d028-42c8-86fb-cabe136eb003%40googlegroups.com.


[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 Google's needs. Outside 
contributions were rare. I got used to it.

I wonder if being "community driven" is really a good thing. GO was 
invented by a tiny team with strict ideas. This is in strong contrast to 
Java or C++, which are bloated and overly complex languages.

There are times I'd rather not have something, say generics, rather than 
pollute the simplicity of the tool to add features that the community 
wants. IMHO, YMMV, etc. 

-- 
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/2d3127c1-7ae6-4106-b5df-90585d32d8d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 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.
For more options, visit https://groups.google.com/d/optout.


[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 correct?

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[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 drivers. I'm hoping to make working 
> with decimals, especially when working with databases, much easier.
>

Not GO specific, but in 40+ years, the only choice for decimal money is to 
store them as pennies. If you like with an OO language, you  can implement 
Money and Dollars (vs Pounds or Euros).

Using floating point for money is a sin.
It simply never works. 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[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 
networking abilities.

But I can't remember who, when or which company.

I would like to at least consider this company and their product.

Anyone remember? hints? links?

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 an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 others have  already said. Plus, the JVM is an impressive bit of work. 
The runtime optimization is first class and does an amazing job.

Benchmarks always lie. Mostly because they ask the wrong question. You 
don't care if one program or another is 5% faster. Software engineering is 
about the cost over the life-cycle, that includes hardware to run it on, 
and all the software engineering effort to implement and maintain the code. 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[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. That may 
be enough, if not use other easy keys like 0101010101

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[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 existing records, which will have 
> already hashed user passwords.
>

Unless you are forced to use SHA1, don't use it. Plan a transition from the 
legacy system, or legacy hash. Such as implement a better, more modern and 
more secure hash in the legacy system and prompt the users to change their 
password.

When the NIST says "use a better cipher" (or hash or whatever) listen to 
them and don't use the old one anymore. 

No software written in 2019 should use things like MD5, SHA1, DES and all 
that similar stuff that was probably OK in 1975. Computers are faster and 
attacks are smarter.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


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, do it in go, learn and if when I get smarter, 
I find it doesn't work, I can adjust.
I've already learned to use 20 or 30 languages, so learning a couple more 
is not a big deal.
I know that python has a lot of fans, but go meets my theology far better 
than python

Plus Rob Pike keeps saying that the GC is getting better every release and 
I believe in Rob Pike


> 2) what hardware should I use? RaspberryPI, or some super Arduino? or a 
> more specific microcontroller, perhaps controlled by a R-PI? 
>
> RasPIs are cheap and have a large community, but are a little weak at I/O. 
> I'm a big fan of the Beaglebone, which is not quite at RasPI's level


I'm going to start with an R-Pi, and see. Weak at IO matches up nicely with 
Linux's refusal to really do real time. I half expected everyone to yell 
"you have to use a RTOS" but that hasn't happened. Maybe all the RTOS folks 
have already rejected go. I've done far too much professional C, I have no 
interest in doing it for fun.
 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[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 standard in 15 January 1977 as FIPS PUB 46, it has been 
obsolete for all of this century. It was replaced by AES in 2002

Do not use DES for anything, not even protecting things from your baby 
sister. Use a real, modern strong cipher.

>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


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 sufficient.

 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[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...
>
> And you'll need some sort of simple GUI for simulation, loop monitoring 
> and control parameter adaptation...
>

Go is a terrible choice, IMHO, for any front-end stuff.
I see zero reason to use go for the GUI, simulation stuff. 

I've never seen a cross platform language that was worth a damn, just bite 
the bullet and develop for your target world.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[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 
controllers, etc. myself. I'm a pretty experience programmer, done OS 
internal work, DBMS driver internals, networking, etc all at pretty low 
level. I do not want to just grab a library off github that "handles the 
sensor", I want to implement the algorithms, just like you would in C, but 
in go.

Naturally, my first thought was to implement a flight controller for an 
autonomous quad copter, but upon further review, I think that's a bit 
ambitious. So now I have three projects:

1) control the temperature of an incandescent light bulb (one controll)
2) balance a broomstick upside down (two controllers X and Y)
3) flight control for three phase brushless motors.
4) fully autonomous flight

I'm not sure that any of these really require "hard real-time" as we aren't 
trying to control a nuclear reactor or a race car at speeds, but it also 
has more serious restrictions than a web-based chat server.

My initial concept was that I'd grab a recent Raspberry PI, crank up the 
ARM cross compiler switches and have fun.

But, I'm not sure that I want or need Linux. And maybe I want to 
specifically exclude Linux for a RTOS. 

So now I have 3 main questions:
1) is go a bad choice for implementing this?
2) what hardware should I use? RaspberryPI, or some super Arduino? or a 
more specific microcontroller, perhaps controlled by a R-PI?
3) what OS?  (Choices restricted to some flavor of Unix/Linux, or an RTos, 
no OS-X, IOS, or Windows need apply)

And yes, I know you can buy a quad-copter flight controller for $30 or so, 
but I'm much more interested in learning than just flying around taking spy 
photos.


Thanks
Pat

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[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 web frameworks that the world has 
developed over the past 25 or so years.
Your article is a good start, but another black hole of bugs is making the 
browser buttons (next, back, refresh) work all the time, with idempotency, 
etc.
 Users tend to use back/next/refresh in the worst possible places.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[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 
function names, understand imports, and give some assistance.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


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 hunt. or C# and Windows
The topic was Java's claim for write-once, run-everywhere. Debate tip: 
don't use one OS, such as Android, to prove "everywhere"
It kinda ignores wide-spread platforms such as OS-X, Windows, Linux, iOS, 
and then there are niche platforms like BSD. Everywhere includes all the 
majors and all the niche.

Arguing against Java in terms of “generics are done poorly”, and citing a 
> third-party FAQ is absurd. The “core" Java tutorial on generics is a 3-4 
> pages, and almost every Java developer never goes beyond that. 99.% of 
> Java generic use cases are self explanatory or explained in a matter of 
> minutes to anyone with any development experience.
>


Got proof, citations for your 99.% claim? I bet not.
If you look at forums such as JavaRanch, you will see lots of questions 
about Java's generics, and lots of references to the third party FAQ.

My point is that Java generics were hacked onto the language with an 
attempt to keep backward compatibility. They are a mess. I won't bother to 
list why. Go is nice and clean, and I don't think hacking generics into GO 
using backwards compatibility as the holy grail is a good idea.  Its all 
IMHO.

You have not convinced me, and I doubt I can convince you. So let it drop.

I sure hope that GO doesn't botch it like Java did.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[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 
> implementation to make sure it worked - not the business. The write-once 
> run “anywhere” was icing on the cake - it opened doors to some markets very 
> cheaply.
> [snip]
> I think Go would be best served by ensuring that any future release is 
> 100% backwards compatible with previous releases. This is the number one 
> aspect of Java (IMO) that lead to its success - it drastically reduced the 
> churn/expense of delivering software. Businesses like this…. Developers 
> like this...
>

Actually, Java never delivered on the claimed "write once, run anywhere" 
idea. Its simply not feasible unless you restrict the domain to a small 
subset, say command line utilities that take arguments and switched from 
stdin. Smalltalk also claimed this, in a more general, GUI environment. It 
too failed to deliver. Decades before, COBOL was an attempt to do this. the 
"C" in COBOL stands for Common.

IMHO, its impossible to design a language to deliver this run anywhere idea 
when we have no idea how future user interfaces will work. For a couple of 
decades, punched cards were a near universal UI. Then command lines, then 
GUI with mice, pointers and windows. Clearly touch and voice are hot topics 
today. I expect some sort of mental telepathy will be hot in the future.

This leads to my second issue with the OP's ideas. I strongly believe that 
Java has been damaged by its attempt to deliver backward compatability. 
While others have brought up the potential issues with keywords, a much 
more telling disaster was Java's implementation of generics. It was done in 
a language compatable way, but there result was design choices and 
restrictions that make it nearly impossible to use Java generics 
"properly". Lest you think I exaggerate, look at Exhibit 1, the FAQ on how 
to actually use it is huge. It has hundreds of edge cases. See 
FAQ. http://www.angelikalanger.com/GenericsFAQ/JavaGenericsFAQ.html

If the implementation had decided to not require backwards compatibility, 
they might have been able to design generics such that there is no need for 
thousands of special case rules that are Frequently Asked.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


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 documentation (I didn't 
look into the source).
I am just looking for a solid implementation. I'm glad I don't need to go 
to the crypt version because I have no need for that level of rigor. 
Did I miss something in the documentation? 

Thanks
Pat

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[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 bits of state. Since  52!  ≈ 2^
225.6 
we really need at least 225 bits of state within the PRNG.

I can't be the first one to look for an algorithm to shuffle a single 52 
card deck.

What tools and/or approaches are suitable?

-- 
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.
For more options, visit https://groups.google.com/d/optout.


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 
usual stuff with go
Seems like a reasonable requirement for me.

I will gladly grant that most of the frameworks for other languages are 
huge, bloated messes that are not consistent, clean and worst, not 
orthogonal, all of which are beauties of go's design. But a beautiful 
design is not a good thing if you  can't write a simple application (web 
app in this case) that actually works properly on browsers that real users 
have in the real world.

The "back button" issue has been around since folks first started web 
writing applications in the mid-90s. Sadly, for a trivial problem 
statement, its still a far more difficult issue than it should be.

Simple stuff should be simple. Its the design goal of every modern tool. 
For 99% of what I think I want, go meets it. But in the real world, users 
expect GUIs and that means browsers. So the back and forward and refresh 
buttons have to do the right thing.

IMHO, YMMV, etc 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[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 page to reload instead of using the 
> cache:
>
>
> // 
> https://stackoverflow.com/questions/8788802/prevent-safari-loading-from-cache-when-back-button-is-clicked/13123626#13123626
> // 
> https://stackoverflow.com/questions/17432899/javascript-bfcache-pageshow-event-event-persisted-always-set-to-false
> $(window).bind("pageshow", function(event) {
> if (event.originalEvent.persisted || (window.performance && (window.
> performance.navigation.type == 2))) {
> window.location.reload();
> }
> });
>
>
>
Interesting. Does this work on all browsers on all platforms? 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[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 the stdlib

The key question to me about using anything is how complex is it versus 
what i need.

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.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[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 the 
> authorization in every request. Writing your own isn't complex.
>


In a pure micro-services architecture, you have to check every request in 
every micro-service, its the nature of the beast. Of course, you pass 
around a local token that expires in a 'short' time.

Wiring your own that mostly works is trivial. Getting all the tiny details 
is very pedantic, and its easy to get wrong. Which is why its critical to 
ask how serious you are about value and potential attackers

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[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 information you are sending, retrieving, etc.?)
4) how much do you trust the remote client?
5) how paranoid are you?
6) do you trust some third party middleware?

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[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 ASN.1 PER or DER in two decades.
I know it still is listed in the specs, but  ASN.1 was  worse than XML

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[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 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.
For more options, visit https://groups.google.com/d/optout.


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 file triggers a Windows application, sure. But is the actual go 
binary different?
Its possible to make a Posix compliant system call on nearly any operating 
system. Posix was
designed to let the US Government require Unix, back when Unix was special. 
But the basic functions
that most of us call Unix or Linux system calls are trivial in any 
operating system. Probably even Plan-9

There is a lot less to making bash, and apt-get run on any operating system 
than many folks think

I may have to do both installs and do a shasum on the files.
 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


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 convinced that there is any actual
difference
between the go.exe you get with the MSI and the go binary that apt-get
installs

I've got it running now, but I am not sure exactly what I did to get it all
working (altho the symlink was obvious)

Bill, between you and I, we have 70+ years experience at this, you'd think
we could get a compiler installed.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[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:28:42 UTC+11, Pat Farrell wrote:
> > Yes, I didn't understand what a "workspace" is. Still don't know what 
> that buzzword means.
>
> I suggested you read https://golang.org/doc/code.html - it should answer 
> your question. 
>

I saw you write that. But there was nothing that told me why.
I started at golang.org and have been following the instructions.
There was no reference to this document in any of the installation 
instruction pages.

Again, it looks like someone who hated Windows (and I hate Windows as much 
as any other developer) 
was forced to implement it and wrote the minimal documentation they could. 
They did this long ago, and no one has updated it



|| when you write programs with Go all your source code, compiled packages 
and final binaries will be stored inside of single 
|| directory on your computer. 

Seriously? That sure seem like bad practices to me. Nearly all the code 
I've worked on over the past 40 years was too big to go into a single 
directory.



```
> set GOPATH=c:\gopath
> ```
>

Which is a Linux-type instruction. Doesn't work on Windows


 
> > That thread is at least a year old. Back then it was in Beta from MS. 
> Its released now.
>
> Sure. But Go is still not supported on WSL.
>

That is a bug.

 

>  If you want to use development environment with bugs, then sure, you 
> could do that. 
>

I'm sorry, this attitude is not helpful.




> > Go is claimed to be cross platform, and the language sure looks to be 
> that way. But the installation instructions on Windows seem to be an 
> afterthought and fairly out of date.
>
> It is hard for me to judge (I have used Go for many years). 
>

Clearly you have not tried to start with zero knowledge on windows.
I'm sure its much easier if you use a prefered OS such as Linux.


> Go, its libraries and tools are written in Go. So Go installation does not 
> installs any gnu / cygwin stuff. 
>

The installation for binaries uses some standard Windows installation tool, 
been the same since about Windows 95.
Its clearly not written in go

Perhaps once I get this all working, I'll see the native go tools and 
libraries. But I'm not there yet.

I have now been dorking around on this for a couple of days. If I was not 
intrigued about how great go would be, I'd have stopped already. Something 
that I randomly clicked on to make this work started a cygwin shell. I have 
no idea what. Nor do I know what installed it.

I'd rather that this remain unanswered until someone who has active 
knowledge about what is happening with the go on Windows installation can 
chime in.

Thanks
Pat

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[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://golang.org/doc/code.html ?
>


https://golang.org/doc/install

 

> > 2) how do I get the go build process to create a hello.exe rather than 
> go.exe?
>
> I suspect Go uses your current directory to name your output file. Read 
> https://golang.org/doc/code.html how to organize your Go code. You could 
> also use -o flag to provide whatever output file name you like, for example 
> "go build -o hello.exe".
>

I'll try that.
 

> > 3) how do I get the bash shell to let me just type 'go build' like we 
> all want?
>
> What bash shell are you talking about? Windows does not come with bash 
> shell. If you have Linux install, then you should install Linux version of 
> Go, not Windows version of Go.
>

You are way out of date on this one. After decades of providing a terrible 
shell, Microsoft has decided to provide a real bash shell with real Ubuntu 
utilities.   It has apt-get and is pretty nice, way better than the old cmd 
shell
https://msdn.microsoft.com/en-us/commandline/wsl/about

Still need to figure out how to make a simple 'go build' work
rather than having to enter 'go.exe build' all the time

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[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 cmd shell
'go build' works, but creates a file go.exe that when run, displays hello 
world
it does not create the expected hello.exe

in the bash shell, 'go build' does not work, it whines that 'go' is not a 
program

The program 'go' is currently not installed. You can install it by typing:
sudo apt-get install gccgo-go



but 'go.exe build' does create a local go.exe which executes and displays 
the expected hello world.

Which raises a couple of questions:

1) is the standard documentation wrong/out of date?
2) how do I get the go build process to create a hello.exe rather than 
go.exe?
3) how do I get the bash shell to let me just type 'go build' like we all 
want?



-- 
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.
For more options, visit https://groups.google.com/d/optout.