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
A
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, Mic
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 f
/golang/2016/01/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
act)
If anybody knows of a less-dirty way to handle this, or make that code
cleaner... please let me know. I don't like the way it's being handled
now, but at least it's working now. Thank you!
On Tuesday, August 22, 2017 at 5:48:09 PM UTC-5, Eric Brown wrote:
>
> Let'
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 Contac
penbsd`
> 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:
>>
>> Thi
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:
//
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 same
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 sni
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(
memoryBlock := make([]byte, 4)
binary.LittleEndian.PutUint32(memoryBlock, 12345678)
ses latest
> 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 2
ses latest
> 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 2
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`" (w
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 would put the result of the git
command w/ flags into it)
however, I just can't get it to work (if it's even pos
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 golang-nuts+u
each their own...
On Saturday, January 14, 2017 at 3:31:32 PM UTC-6, Eric Brown wrote:
>
> 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 'mi
x27;t have pre-emptively posted this now. My apologies...
On Saturday, January 14, 2017 at 3:31:32 PM UTC-6, Eric Brown wrote:
>
> 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
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
poin
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
Hahaha... thanks, Shawn. Appreciate the assistance.
On Sunday, January 8, 2017 at 12:37:16 AM UTC-6, Shawn Milochik wrote:
>
> Not only rookie. I've done it a number of times. 😎
>
> On Jan 8, 2017 01:35, "Eric Brown" > wrote:
>
>>
>>
>> On
Simple example... what am I doing wrong?
https://play.golang.org/p/WR9yehNF5_
--
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...@googlegroup
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,
query.
>
> 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,
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
figurationFile)
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 Dece
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
functi
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 supp
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 s
30 matches
Mail list logo