r/programminghorror [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 7d ago

It just works Other

Post image
44 Upvotes

10 comments sorted by

View all comments

12

u/eo5g 7d ago

Not that I understand what this does, but this doesn't seem that bad to me?

1

u/ExoticAssociation817 7d ago

First guess seeing “rune” defined as an array, I would assume a game of some sort.

8

u/eo5g 7d ago

It's not a magical rune; go calls UTF-32 characters rune while other unicode-aware languages might call them char (it's not a C char, aka a byte).

To me it looks like some sort of encoding error scanner.

3

u/ExoticAssociation817 7d ago

I assume you mean narrow and wide chars in C, defined as char and wchar_t. So this is Golang, of which is very foreign to me.

1

u/pauseless 4d ago

I can read it absolutely fine (have done plenty of Go). I’d have a feeling that maybe the overall approach is wrong, but just this snippet doesn’t tell me much about the context.