just because a footgun exists, doesn't mean you should use it
"Because Go doesn't support it" would also be a reason to avoid:
* Generics (at least until recently)
* Classes
* Prototypes
* Exceptions
* Async/Await
* Package managers (until recently)
* Algebraic data types
* Effect types
* Type inference
* Type classes
* Etc.
You could argue that one or more of these are footguns, but I seriously doubt you'd consider them all to be, so let's talk about what separates the footgun from the feature that just didn't fit in Go's design.
Something tells me you'd hate my five-line implementation of the standard library function fgets in C.
char *fgets(char *buf, size_t n, FILE *fp) {
char *p = buf;
int c = 0;
while (n > 1 && (c = getc(fp)) != EOF && (*p++ = c) != '\n')
n--;
return n > 0 && (c != EOF || feof(fp) && p != buf) ? *p = '\0', buf : 0;
}
I'm joking; I'd never write code this way in earnest.