[go-nuts] Re: Go 1.7 Release Candidate 1 is released

2016-07-09 Thread Eric Brown
Look at the release notes, under 'Compiler Toolchain', about 20% scroll down the page. Try the compiler arguments provided and see if disabling the new compiler back-end ( -ssa=0 ) resolves this and report your results. On Friday, July 8, 2016 at 4:08:31 AM UTC-5, Lucio wrote: > > This may be

[go-nuts] Re: -ldflags -X

2017-01-26 Thread Eric Brown
! On Thursday, January 26, 2017 at 9:58:49 PM UTC-6, Eric Brown wrote: > > Using -ldflags -X, is there a way to set the internal value as the output > of an executable console file? > > I've seen examples like this: > > "-X main.githash=`git rev-parse HEAD`" (which

Re: [go-nuts] Re: -ldflags -X

2017-01-26 Thread Eric Brown
atest > tag from git repo as version. > > echo Rebuilding App... > for /f %%i in ('git describe --tags ') do set version=%%i > go install -a -v -ldflags "-X main.versionBuild=%version%" > > > > Sincerely, > Arafath M > > On Fri, Jan 27, 2017 at 1

Re: [go-nuts] Re: -ldflags -X

2017-01-26 Thread Eric Brown
atest > tag from git repo as version. > > echo Rebuilding App... > for /f %%i in ('git describe --tags ') do set version=%%i > go install -a -v -ldflags "-X main.versionBuild=%version%" > > > > Sincerely, > Arafath M > > On Fri, Jan 27, 2017 at 1

[go-nuts] func return with if... else...

2017-01-14 Thread Eric Brown
Using go, when I create a function with a return... and that function uses an if... else... condition w/ the return being passed under each, the compiler still throws an error 'missing return at end of function'? I can put a return at the end of the function, but it will never get to that

[go-nuts] concurrent sqlite database access... how to handle?

2016-12-28 Thread Eric Brown
I have a function that you can pass the targeted sqlite database and query information, and it executes that query. This function will be used concurrently in goroutines. The sqlite package I'm using is mattn's (https://github.com/mattn/go-sqlite3). It specifically says that it does not

[go-nuts] Re: json.Marshal... what am I doing wrong here?

2017-01-07 Thread Eric Brown
On Sunday, January 8, 2017 at 12:30:43 AM UTC-6, Eric Brown wrote: > > Simple example... what am I doing wrong? > > https://play.golang.org/p/WR9yehNF5_ > Found the mistake. I limited the scope of the structure fields by not capitalizing them. Once I did, it worked as ex

[go-nuts] Re: concurrent sqlite database access... how to handle?

2016-12-29 Thread Eric Brown
Thanks Val, I actually tried that approach... and failed. Perhaps I incorporated it wrong. I put the handling of locking/unlocking of the map[string]*sync.Mutex in it's own function, which was encapsulated in the global mutex like you suggested. Only problem was, was that the database

[go-nuts] Re: concurrent sqlite database access... how to handle?

2016-12-29 Thread Eric Brown
Sorry, left some comments and stuff in there. Tried to condense it as much as possible. On Thursday, December 29, 2016 at 2:16:46 PM UTC-6, Eric Brown wrote: > > package configurationLockExample > > import ( > "sync" > ) > > type _lockReference struct

[go-nuts] Re: concurrent sqlite database access... how to handle?

2016-12-29 Thread Eric Brown
defer _configurationLock.Unlock(configurationFile) // handle configuration stuff here } On Thursday, December 29, 2016 at 1:13:50 PM UTC-6, Dave Cheney wrote: > > Could you show some code, perhaps we can spot the point you're going wrong. > > On Friday, 30 December 2016 05:43:19 UT

[go-nuts] Re: concurrent sqlite database access... how to handle?

2016-12-29 Thread Eric Brown
t; For the general problem of re-acquiring a mutex, I learned today in the > archives that code involving recursive (reentrant) mutex locking is frowned > upon, regarded as a code smell, a bad practice that is very bug-prone. > > Cheers > Val > > On Thursday, December 29, 2

[go-nuts] Re: concurrent sqlite database access... how to handle?

2016-12-29 Thread Eric Brown
Thank you, Dave. That was just code I copied & pasted, and removed pieces while in the textarea submit box on this page. I didn't know about this way of the map lookup... thanks. I'm still learning Go. It's actually my first language, and still need to look into coding standards and syntax,

[go-nuts] Re: func return with if... else...

2017-01-14 Thread Eric Brown
Thank you... On Saturday, January 14, 2017 at 4:44:33 PM UTC-6, Dave Cheney wrote: > > The former. -- 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

[go-nuts] Re: constant 256 overflows byte

2017-03-07 Thread Eric Brown
By the way, this is code snipped from within a conditional check, so memoryBlock[2] will always be < 187 in this situation. On Tuesday, March 7, 2017 at 6:02:59 PM UTC-6, Eric Brown wrote: > > memoryBlock := make(

Re: [go-nuts] Re: constant 256 overflows byte

2017-03-07 Thread Eric Brown
Actually, I didn't catch the int() in your example. I tried it, and it worked! Thank you... On Tuesday, March 7, 2017 at 6:47:11 PM UTC-6, Eric Brown wrote: > > Thanks for the reply, Ayan. I thought so too; however, I previously tried > this... and it resulted in the s

Re: [go-nuts] Re: constant 256 overflows byte

2017-03-07 Thread Eric Brown
Thanks for the reply, Ayan. I thought so too; however, I previously tried this... and it resulted in the same error. On Tuesday, March 7, 2017 at 6:34:27 PM UTC-6, Ayan George wrote: > > > > On 03/07/2017 07:06 PM, Eric Brown wrote: > > By the way, this is code s

[go-nuts] constant 256 overflows byte

2017-03-07 Thread Eric Brown
memoryBlock := make([]byte, 4) binary.LittleEndian.PutUint32(memoryBlock, 12345678)

[go-nuts] runtime.GOOS case

2017-08-07 Thread Eric Brown
This may be a completely stupid or trivial question; however... I currently use this on some old code I'm working on and trying to clean things up: switch os := strings.ToLower(runtime.GOOS); os { case "windows": // do windows stuff here case "linux": // do linux stuff here default:

[go-nuts] Re: runtime.GOOS case

2017-08-07 Thread Eric Brown
t; const GOOS = `plan9` > const GOOS = `solaris` > const GOOS = `windows` > > But it's usually better to rely on build constraints rather than > conditionals at runtime. > > > > On Monday, August 7, 2017 at 5:00:24 PM UTC-4, Eric Brown wrote: >> >> This may b

Re: [go-nuts] check for *string that is nil

2017-08-22 Thread Eric Brown
/23/golang-when-to-use-string-pointers.html On Tuesday, August 22, 2017 at 7:31:55 PM UTC-5, kortschak wrote: > > Is there a reason to have the fields be *string rather than just > string? > > On Tue, 2017-08-22 at 15:48 -0700, Eric Brown wrote: > > Let's say I have a str

[go-nuts] check for *string that is nil

2017-08-22 Thread Eric Brown
Let's say I have a struct... type Contact struct { Idint `json:"id"` FirstName *string `json:"firstname"` LastName *string `json:"lastname"` Email *string `json:"email"` Phone *string `json:"phone"` Ext *string `json:"ext"` } I define contact... var contact

Re: [go-nuts] getting values from memory addresses within another process...

2020-04-30 Thread Eric Brown
I’m attempting to do exactly what ‘Cheat Engine’ and things like AutoHotKey can do. ‘Cheat Engine’ handles this just fine on all my platforms. On Thu, Apr 30, 2020 at 10:01 PM Michael Jones wrote: > The general dangerous ability to do this is why protected mode went into > the i368 and is the

Re: [go-nuts] getting values from memory addresses within another process...

2020-04-30 Thread Eric Brown
I’ll look into this solution. Thank you for an answer that points me in a possible direction. On Thu, Apr 30, 2020 at 10:24 PM Robert Engels wrote: > This can be done fairly easily if you run the Go process as root and read > the /proc/$pid/mem pseudo file. > > On Apr 30, 2020, at 10:01 PM,

[go-nuts] Re: Assignment of pointer values in a struct...

2020-06-04 Thread eric . brown
When you need to differentiate between nil and and empty string (because whatever you're assigning to, a "" may be valid). For lack of time (and going into detail myself), here's a write-up on a reason why: https://dhdersch.github.io/golang/2016/01/23/golang-when-to-use-string-pointers.html