[go-nuts] Simple exec.Command() program

2017-11-12 Thread bucarr
package main import( "fmt" "os/exec" ) func main () cmd := exec.Command("ls", ">", "/dev/null") output, err := cmd.CombinedOutput() if err != nil { fmt.Println(fmt.Sprint(err) + ": " + string(output)) } When I run this go program I get: exit status: 1: ls: >:No such file or directory /dev/null

[go-nuts] Re: Simple exec.Command() program

2017-11-13 Thread bucarr
> > You guys are great. Not only did you explain at length, what I was > misunderstanding, but you offered several solutions. > Thanks to one and all! -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

[go-nuts] Reading an .ini file

2017-01-14 Thread bucarr
Rankest beginner here. Trying to learn Go by converting an old Visual Basic application to Go (yeah, right) on Windows 10 (got all the database stuff working with both postgre and sqlite!) The application needs to read an .ini file to get path/filename. It bombs on the first line. This is fr

[go-nuts] Re: Reading an .ini file

2017-01-14 Thread bucarr
> Thank you all for the suggestions. Some of them are WAY above my pay > grade presently. I'll try one of the other suggested packages. > On Saturday, January 14, 2017 at 9:46:47 AM UTC-7, buc...@gmail.com wrote: > > > -- You received this message because you are subscribed to the Goo

[go-nuts] Warning: Failure to Cross-Compile

2018-02-17 Thread bucarr
Newbie here. Learning to program in Go... Just upgraded from 1.8.1 --> the wonderful 1.10; easy to do and smooth (thank you Go Team!!!). Compiling is faster still! Question for the congregants: I write my Go code on a Windows 10 box using VS Code. Env variable GOOS set to 'freebsd' (my tar

Re: [go-nuts] Warning: Failure to Cross-Compile

2018-02-17 Thread bucarr
Precisely (as an example, same failure notice): VS Code with the lukehoban plugin installed. The plugin gives me this message: "The Go extension is better with the latest version of "goreturns". Use "go get -u -v sourcegraph.com/sqs/goreturns" I click "install" and get this: Installing 1 t

Re: [go-nuts] Warning: Failure to Cross-Compile

2018-02-17 Thread bucarr
Okay. I've deleted the env variable GOBIN. Next time I'm offered to install goreturn I'll select it and see what happens. Thank you, Ian! On Saturday, February 17, 2018 at 11:50:15 AM UTC-7, Ian Lance Taylor wrote: > > > > My GOBIN = C:\Users\AKC\Go_Projects\bin > > Don't set GOBIN. As the

[go-nuts] strings.Split behavior

2018-02-20 Thread bucarr
package main import ( "fmt" "strings" ) func main() } s := "this/that there/here that/this" tmp := strings.Split(s, "/") fmt.Println(tmp) for _, s1 := range tmp { if strings.Contains(s1, "that") { fmt.Println(s1) } } } Output: this was as expected: [this that there here that this]

Re: [go-nuts] strings.Split behavior

2018-02-20 Thread bucarr
On Tuesday, February 20, 2018 at 2:00:32 PM UTC-7, Jan Mercl wrote: > > > I don't know how the concept of word got involved in the "expected" > behavior, but the code shown has nothing to do with something like "word". > It works purely with strings and slices of strings and is AFAICT working a

Re: [go-nuts] strings.Split behavior

2018-02-20 Thread bucarr
Thank you, Marvin. About the same time you wrote this, the answer likewise dawned on me. > Look at https://play.golang.org/p/2tz2asuZcGc where I have changed > > fmt.Println(tmp) > to > fmt.Printf("%#v\n", tmp) > > and I think you will understand that tmp does not contain what yo

[go-nuts] Re: New to Go; Saying Hello !

2018-02-23 Thread bucarr
Another newbie here. Welcome and I feel the same way about Go! -- 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 mor

[go-nuts] Re: I am confused.

2018-05-21 Thread bucarr
1. How much room do you have on your C:\ drive? (if the drive is mostly full, you need to delete a bunch of stuff) 2. Is there a directory shown as C:\Go (if so, delete it entirely) 3. Did you download the .msi directly from the golang download site? (if not, delete the .msi you have and redown

[go-nuts] Re: I am confused.

2018-05-23 Thread bucarr
No. It is an IDE. You write your code in the top part of the screen. In the bottom part (the Powershell), you then invoke the compiler with "go build yourfilename.go". Did you get Go installed? On Tuesday, May 22, 2018 at 10:41:07 PM UTC-6, John wrote: > > Is the visual code studio an compi

[go-nuts] Re: I am confused.

2018-05-24 Thread bucarr
When you open VS Code there is a welcome screen. On the left side of the screen you open/create a program filename to work on. Note the BLUE vertical line separating the narrow left window from the larger right window where you do your program editing. Toward the bottom of that window you'll

[go-nuts] Re: ParseFiles equivalent for strings?

2018-08-05 Thread bucarr
After changing from embedding my .html/css code in the body of my .go program, to making a separate, stand-alone .html/css file and including a template.Must(template.ParseFiles("filename.html"))' line in the .go source file, I can see that the go creators are a lot smarter than I am. MUCH eas

[go-nuts] Re: Better way to get the exit status of an os/exec command?

2018-08-05 Thread bucarr
Don't know if this is easier, agree no present way is easy enough, but this worked for one project I was working on: cmd := exec.Command("zfs", "get", "all") _ = cmd.Run() // shamelessly discard any error exitcode := cmd.ProcessState.Sys().(syscall.WaitStatus).ExitStatus() if exitcode != 0 { w

[go-nuts] Re: go language sensitive editor?

2018-11-20 Thread bucarr
Another vote for VS Code. I'm a hobbyist and have tried lots of editors. On Tuesday, November 20, 2018 at 1:52:11 PM UTC-7, Pat Farrell wrote: > > 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 >

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

2019-01-07 Thread bucarr
I spent most of November studying password hashing and IMO argon2id should be used for new projects going forward. Very nice implementation in Go in the x library. I don't speak Java so can't help you there. -- You received this message because you are subscribed to the Google Groups "golang

[go-nuts] Re: How to renderer the multiple html pages ?

2019-02-03 Thread bucarr
What is the error? On Saturday, February 2, 2019 at 10:54:53 PM UTC-7, Robert Hsiung wrote: > > Hi all: > I make three html pages as index.html ,wps1.html and wps2.html. The > three html pages are under the same folder. > The expected flow is to login index.html first and access wps1 or wps2

[go-nuts] Re: parse timestamp in Go

2019-02-07 Thread bucarr
Save it as a string, then access the slice parts of the string: d := datestringtoparse YY := d[0:2] MM := d[2:4] and so forth. On Thursday, February 7, 2019 at 2:28:30 PM UTC-7, Rajanikanth Jammalamadaka wrote: > > How can I parse the following timestamp in Go? > > date +%y%m%d%H%M%S%N > > 1902

[go-nuts] Re: Go 1.12 is Released

2019-02-27 Thread bucarr
Thank you, Go Team! Installed. My complex web app seems to work just fine under 1.12. -- 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...@go

[go-nuts] Re: built-in alternative to bcrypt?

2019-04-22 Thread bucarr
I'm a hobbiest new to Go as well. In the x library (still part of the standard library) written by the Go Authors is argon2. It allows for salting, stretching and hashing passwords. The recent guru commentary I've read is that "new implementations of applications which will use password hashi

[go-nuts] Re: Get fingerprint of ca

2019-04-30 Thread bucarr
If I'm understanding your question correctly, this Youtube video from the 2018 Gophercon should help: https://www.youtube.com/watch?v=kxKLYDLzuHA On Tuesday, April 30, 2019 at 4:01:24 AM UTC-6, Vasiliy Tolstov wrote: > > Also if i use own root ca to issue intermediate cert that used for issue >

Re: [go-nuts] Re: Get fingerprint of ca

2019-04-30 Thread bucarr
Apologies. I'm quite new to Go and what you are seeking is probably over my head. On Tuesday, April 30, 2019 at 1:53:13 PM UTC-6, Vasiliy Tolstov wrote: > > вт, 30 апр. 2019 г. в 16:23, >: > > > > > > If I'm understanding your question correctly, this Youtube video from > the 2018 Gophercon