Update: based on the comment and response so far, I guess I should make it explicit that I understand 0700 is the octal representation of the decimal number
So your file mode was changed from the requested 0274 to the actual on-disk 0254. I'll bet that your umask is 0022. Sounds to me like everything is working fine.
os.FileMode
only knows about integers, it doesn't care whether the literal representation is octal or not.
The fact that 0700
is interpreted in base 8 comes from the language spec itself:
An integer literal is a sequence of digits representing an integer constant. An optional prefix sets a non-decimal base: 0 for octal, 0x or 0X for hexadecimal. In hexadecimal literals, letters a-f and A-F represent values 10 through 15.
This is a fairly standard way of representing literal octal numbers in programming languages.