[go-nuts] Maintaining a connection to Postgresql during database failover

2023-12-31 Thread Dean Schulze
I have a web service in Gin that calls Postgresql running on AWS RDS with multi-az failover. When I reboot with failover the primary database and failover starts calls to the web service hang without even getting to the event handler. Once the failover is complete calls to the web service

Re: [go-nuts] The docs for secretbox seem very wrong

2023-10-09 Thread Dean Schulze
first > parameter to get a fresh slice allocated for you by the append(), but in > hot codepaths involving cryptography, being able to preallocate and reuse > storage (e.g. via sync.Pool) can give you significant reduction in GC > pressure. > > - Dave > > On Mon, Oct 9,

Re: [go-nuts] The docs for secretbox seem very wrong

2023-10-09 Thread Dean Schulze
ear, by explicitly stating that they > return the appended-to slice.0 > > On Mon, Oct 9, 2023 at 3:46 PM Dean Schulze wrote: > >> If the docs are correct, how do you append to nil? That's what the docs >> say. Take a look at them. >> >> Your code example shows

Re: [go-nuts] The docs for secretbox seem very wrong

2023-10-09 Thread Dean Schulze
If the docs are correct, how do you append to nil? That's what the docs say. Take a look at them. Your code example shows the first parameter to Seal() can be nil. So what does that parameter do? How do you append to it? On Sunday, October 8, 2023 at 11:19:13 PM UTC-6 Axel Wagner wrote: >

[go-nuts] The docs for secretbox seem very wrong

2023-10-08 Thread Dean Schulze
The docs for secretbox.Seal say: func Seal(out, message []byte, nonce *[24]byte, key *[32]byte) []byte Seal appends an encrypted and authenticated copy of message to out, which must not overlap message. The key and nonce pair must be

Re: [go-nuts] go get created directories with exclamation points

2023-01-04 Thread Dean Schulze
etBrains, since it knows how to > handle those escaped capital letters. > > -- Marcin > > On Wed, Jan 4, 2023 at 8:30 AM Dean Schulze wrote: > >> I did go get to download some Azure SDK for Go modules. This created >> directories with exclamation points in their names.

Re: [go-nuts] Executing a tar command from within a Go program

2022-04-20 Thread Dean Schulze
rather than just extracting a file from a compressed archive. On Wednesday, April 20, 2022 at 10:28:06 AM UTC-6 wagner riffel wrote: > On Wed Apr 20, 2022 at 6:16 PM CEST, Dean Schulze wrote: > > I need to execute this tar command > > > > *tar xzf dir1/dir2/somefile.tgz

[go-nuts] Executing a tar command from within a Go program

2022-04-20 Thread Dean Schulze
I need to execute this tar command *tar xzf dir1/dir2/somefile.tgz --directory=dir1/dir2/* from within a Go program. I've verified that it works from the command line. I've tried using *argStr := "xzf dir1/dir2/somefile.tgz --directory=dir1/dir2/"output, err := exec.Command("tar",

Re: [go-nuts] Changing channel from unbuffered to buffered prevents goroutine from running

2022-02-11 Thread Dean Schulze
. On Friday, February 11, 2022 at 8:06:55 AM UTC-7 Dean Schulze wrote: > The WaitGroup works if wg.Add() is called within the goroutine. The only > purpose for the WaitGroup is to keep main from exiting before the goroutine > has completed. > > Moving wg.Add() outside of th

Re: [go-nuts] Changing channel from unbuffered to buffered prevents goroutine from running

2022-02-11 Thread Dean Schulze
close() calls should be in the goroutine otherwise the channels could be closed when the function exits while the goroutine is still running. On Friday, February 11, 2022 at 12:47:09 AM UTC-7 Ian Lance Taylor wrote: > On Thu, Feb 10, 2022, 9:52 PM Dean Schulze wrote: > >> Here is

Re: [go-nuts] Changing channel from unbuffered to buffered prevents goroutine from running

2022-02-11 Thread Dean Schulze
-7 Ian Lance Taylor wrote: > On Thu, Feb 10, 2022, 9:52 PM Dean Schulze wrote: > >> Here is an exercise using channels and select in a goroutine. If the >> disconnect channel is changed to a buffered channel the goroutine doesn't >> run at all. >> >>

[go-nuts] Changing channel from unbuffered to buffered prevents goroutine from running

2022-02-10 Thread Dean Schulze
Here is an exercise using channels and select in a goroutine. If the disconnect channel is changed to a buffered channel the goroutine doesn't run at all. Why does changing from an unbuffered to a buffered channel prevent running the goroutine? *

[go-nuts] Where are the golang.org docs on channels?

2021-09-18 Thread Dean Schulze
The only mention of channel in the offical docs is a link to a YouTube video . Aren't there some docs from golang.org on channels? -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] smtp.SendMail not using the from argument

2021-09-11 Thread Dean Schulze
at 22:03:32 UTC+1 dean.w@gmail.com > wrote: > >> It could be that I'm not using smtp.SendMail() correctly, which is why I >> posted it here. Thanks for your guess, though. >> >> On Thursday, September 9, 2021 at 2:31:11 PM UTC-6 rol...@gmail.com >> wrote: >&g

Re: [go-nuts] smtp.SendMail not using the from argument

2021-09-09 Thread Dean Schulze
It could be that I'm not using smtp.SendMail() correctly, which is why I posted it here. Thanks for your guess, though. On Thursday, September 9, 2021 at 2:31:11 PM UTC-6 rol...@gmail.com wrote: > Hello, > > Am Do., 9. Sept. 2021 um 20:19 Uhr schrieb Dean Schulze < > dean.

[go-nuts] smtp.SendMail not using the from argument

2021-09-09 Thread Dean Schulze
I'm sending emails with smtp.SendMail() via gmail. I set the from argument to smtp.SendMail() to a different email address than my gmail username, but the emails still get sent with the From: as my gmail address. Do I need to do something else to change the From: in the emails, or is gmail

Re: [go-nuts] Does the module name have to include the repo name when you publish a Go module?

2021-09-07 Thread Dean Schulze
is hosted on a different domain. > > On Tue, Sep 7, 2021 at 1:05 PM Dean Schulze wrote: > >> Your first paragraph seems to say "no" to my question. But then this >> seems to say "yes" to my question >> >> "In short, the go command needs to

Re: [go-nuts] Does the module name have to include the repo name when you publish a Go module?

2021-09-07 Thread Dean Schulze
ur module is hosted there, > you don't need to stand up a server for that URL. Also, if a path component > ends with ".git", ".hg", etc, the go command will use everything up to > there as the repository URL without performing the lookup. > > > On Tue, Sep 7

[go-nuts] Does the module name have to include the repo name when you publish a Go module?

2021-09-07 Thread Dean Schulze
If you are going to publish a Go module does the module name have to include the repo name? I couldn't find this documented anywhere but through trial and error I've discovered that it is required. I named my module like this and published it to github: *module key-value-mod* In another

[go-nuts] How to use packages and modules with git repositories on private servers

2020-12-08 Thread Dean Schulze
I couldn't get the information I needed when I posted this question on a couple of forums, so I've posted a detailed explanation of how to use packages and modules with git repositories on private servers

[go-nuts] Re: go get not downloading a module under a repository from BitBucket

2020-11-08 Thread Dean Schulze
I created the tag *git tag integration-common/util/v0.0.1* and verified that it got pushed to bitbucket. When I `go get` the tag it shows go get bitbucket.org/orgname/reponame@integration-common/util/v0.0.1 go: bitbucket.org/orgname/reponame/integration-common/util/v0.0.1 => v0.0.1 but

[go-nuts] go get not downloading a module under a repository from BitBucket

2020-11-07 Thread Dean Schulze
In my git repo (bitbucket.org) I have reponame/ .git/ integration1/ integration2/ integration-common/ └── util ├── go.mod └── readascii.go The module directory is a subdirectory of the git repository. The repository is tagged with v0.0.1. Heres the go.mod module

[go-nuts] go install puts my library .a file in the local directory instead of first component of GOPATH

2020-09-06 Thread Dean Schulze
I have a library package like this: └── src └── datepackage └── dateutil.go My GOPATH is set like this: */home/dean/src/golang/go3p:* where /home/dean/src/golang/go3p is where go get installs packages and is the directory above my src/ directory. When I execute *go install

[go-nuts] Re: Getting 410 error from https://sum.golang.org/lookup/github.com for a private github repo

2020-05-18 Thread Dean Schulze
Just verified that this is not due to the repo being private. It happens if the repo is public too. On Monday, May 18, 2020 at 2:02:38 PM UTC-6, Dean Schulze wrote: > > Go get doesn't work with private servers that don't have a web serve set > up on them. So I've switched to a pri

[go-nuts] Getting 410 error from https://sum.golang.org/lookup/github.com for a private github repo

2020-05-18 Thread Dean Schulze
Go get doesn't work with private servers that don't have a web serve set up on them. So I've switched to a private repo on github.com. I'm getting a 410 error now from some proxy. Here's the command: go get github.com/dwschulze/shippy-service-consignment/proto/consignment I get this error:

Re: [go-nuts] Converting a C char[] to []byte of string with cgo

2020-04-30 Thread Dean Schulze
That works. The problem I had earlier with a panic was caused by my C library which was returning null as an error condition. Once the C code was fixed it worked as you said. Thanks. On Thu, Apr 30, 2020 at 2:18 PM Jan Mercl <0xj...@gmail.com> wrote: > On Thu, Apr 30, 2020 at 10:0

Re: [go-nuts] Converting a C char[] to []byte of string with cgo

2020-04-30 Thread Dean Schulze
> > That compiles but it still panics: > > test: bad machine line11=(null), return > panic: runtime error: invalid memory address or nil pointer dereference > [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4949f2] > > goroutine 1 [running]: > main.(*LineStruct).MachineName(...) >

Re: [go-nuts] Converting a C char[] to []byte of string with cgo

2020-04-30 Thread Dean Schulze
; C.GoString((C.char*)()) > > (untested) > > > On Thu, Apr 30, 2020 at 1:06 PM Dean Schulze > wrote: > >> That gives this error (which I've gotten with just about everything I >> try): >> >> cannot use _name (type *[25]_Ctype_char) as type *_Ct

Re: [go-nuts] Converting a C char[] to []byte of string with cgo

2020-04-30 Thread Dean Schulze
Mercl wrote: > > On Thu, Apr 30, 2020 at 8:17 PM Dean Schulze > wrote: > > > > I must be missing something pretty simple, but I have a C struct like > this: > > > > typedef struct line > > { > > char hostname[HOSTNAME_MAX]; > >

[go-nuts] Re: Converting a C char[] to []byte of string with cgo

2020-04-30 Thread Dean Schulze
I've also tried this var src [24]C.char = p.mach_ip and this var src *[24]C.char = _ip and both give panics. > > -- 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

[go-nuts] Converting a C char[] to []byte of string with cgo

2020-04-30 Thread Dean Schulze
I must be missing something pretty simple, but I have a C struct like this: typedef struct line { char hostname[HOSTNAME_MAX]; char ip[IP_MAX]; ... } When I try to do the simple thing C.GoString(p.hostname) I get an error like cannot use p.hostname (type [25]_Ctype_char) as type

[go-nuts] Re: cgo can't find .so in same directory

2020-04-30 Thread Dean Schulze
t; exeutable > LD_LIBRARY_PATH=${PWD} ./app > > > On Thursday, April 30, 2020 at 7:19:36 AM UTC+3, Dean Schulze wrote: >> >> I'm following a simple example >> <https://www.thegoldfish.org/2019/04/using-c-libraries-from-go/> of >> using cgo to call a C

[go-nuts] cgo can't find .so in same directory

2020-04-29 Thread Dean Schulze
I'm following a simple example of using cgo to call a C library function from go. Executing the binary gives error while loading shared libraries: libperson.so: cannot open shared object file: No such file or director Here's

[go-nuts] How can I syslog without PID

2020-04-16 Thread Dean Schulze
I have a C program with a syslog command like this: syslog(LOG_INFO, "slurmctrld: initializing resources"); It outputs the first line below in the syslog. This C code executes a golang binary that also does syslog commands: Syslogger, err = syslog.New(syslog.LOG_INFO, "slurmctld")

[go-nuts] Using modules with private repos

2020-03-11 Thread Dean Schulze
The docs for modules assume that you'll be publishing your golang modules (actually a git push) to the few public repos that golang has built in support for. I want to use a private repo, but there doesn't seem to be any docs for that. This post

Re: [go-nuts] Re: Where is the version number for a golang module declared?

2020-03-11 Thread Dean Schulze
ntroduction, and note that https://golang.org/doc/code.html is now > written for module mode rather than GOPATH mode. > > On Wed, Mar 11, 2020 at 2:33 PM Dean Schulze > wrote: > >> Well, that was going to be my next question (how do I install a module >> from a local git repo or

[go-nuts] Re: Where is the version number for a golang module declared?

2020-03-11 Thread Dean Schulze
Well, that was going to be my next question (how do I install a module from a local git repo or directory). If I understand you correctly go modules require a remote git repo, even if they are used only one machine. That should be made clear in the docs. Modules get cached locally in

[go-nuts] Re: Where is the version number for a golang module declared?

2020-03-10 Thread Dean Schulze
This blog entry uses git tags. It didn't mention branches. Are tags the only way to declare a version number? Also, what if my git repo is local to my laptop? I'd think I should still be able to publish versioned modules to my local GOPATH

[go-nuts] Where is the version number for a golang module declared?

2020-03-10 Thread Dean Schulze
The various examples I've seen for using golang modules describe how to specify the version number of a dependency, but I haven't seen how to declare the version number of a module. Some examples suggest adding a /vN to the import path where N is the major version number, but don't say

[go-nuts] exec.Command() always returns error status of 1 when it was executed successfully

2020-02-17 Thread Dean Schulze
This command always sets the err to "exit status 1" even though it executes correctly: out, err := exec.Command("/bin/bash", "-c", "lspci | grep -i vga | grep -i nvidia").CombinedOutput() I expected it to return 0 when executing successfully. What am I missing? -- You received this message