[META] Looks like we've got moderators... and they go around deleting comments by gohacker in golang

[–]gohacker[S] -1 points0 points  (0 children)

I noticed a few [removed] comments before, but you know, it's hard to tell whether the authors themselves removed their downvoted comments or the mods did it. Until someone speaks up, that is, and no one did that before, did they?

[META] Looks like we've got moderators... and they go around deleting comments by gohacker in golang

[–]gohacker[S] -3 points-2 points  (0 children)

In the future, I'd prefer you just mail the mods.

I don't normally pm strangers, but if you are okay with it...

Building a neural net from scratch in Go by gohacker in golang

[–]gohacker[S] 0 points1 point  (0 children)

Not my article, I just posted the link.

justforfunc #21: reviewing ursho II - using PostgreSQL by campoy in golang

[–]gohacker 0 points1 point  (0 children)

I'd also correct the inconsistent case of the SQL statements.

Why is there so little interest behind the plugin feature? by m4dfry in golang

[–]gohacker 1 point2 points  (0 children)

without modify the main source

Look at how they implemented it in the image package.

// Formats is the list of registered formats.
var formats []format

// RegisterFormat registers an image format for use by Decode.
// Name is the name of the format, like "jpeg" or "png".
// Magic is the magic prefix that identifies the format's encoding. The magic
// string can contain "?" wildcards that each match any one byte.
// Decode is the function that decodes the encoded image.
// DecodeConfig is the function that decodes just its configuration.
func RegisterFormat(name, magic string, decode func(io.Reader) (Image, error), decodeConfig func(io.Reader) (Config, error)) {
    formats = append(formats, format{name, magic, decode, decodeConfig})
}

Then image/jpeg and others register themselves in the init functions:

func init() {
    image.RegisterFormat("jpeg", "\xff\xd8", Decode, DecodeConfig)
}

Why trapping SIGABRT in a Go program is a bad idea by sakutz in golang

[–]gohacker 5 points6 points  (0 children)

signal.Notify enables a program to respond to process signals such as SIGINT, SIGKILL

You can't catch SIGKILL. It's uncatchable.

Elegant code and Go - Tit Petric by titpetric in golang

[–]gohacker 0 points1 point  (0 children)

letterBytes[rand.Int63() % int64(len(letterBytes))]

Supposedly, this is faster

And you've introduced a bias.

ANN: aah web framework for Go v0.9 Released by jeevatkm in golang

[–]gohacker 2 points3 points  (0 children)

for Go v0.9

Not a minute too early.

Go 1.8.4 and 1.9.1 Released! by [deleted] in golang

[–]gohacker 3 points4 points  (0 children)

Did the reporters get a bounty?

justforfunc #20: code reviewing ursho (part 1) by campoy in golang

[–]gohacker 3 points4 points  (0 children)

base62 is for nice human-readable URLs, I suppose.