All Go Rust Python PHP JavaScript
Chrome Dev Summit to secure your spot in workshops, office hours and learning lounges!

How to Append Text to a File in Go

In Golang, using the os.O_APPEND flag is the easiest way to append text to a file Using os.OpenFile Function OpenFile is the generalized open call; most users will use Open or Create instead. It opens the named file with specified flag (O_RDONLY etc...

How to Get the Maximum Value for an Int Type in Go

In Golang, there are 2 ways to get the maximum value for an int type. Using constant values Since integer types use two's complement arithmetic, you can infer the min/max constant values for int and uint. For example, package main import ( "...

How to format a date or time in Go

In Golang, there are two ways to format the time.The layout string Go doesn’t use yyyy-mm-dd layout to format a time. Instead, you format a special layout parameter. 2006-01-02 15:04:05.999999999 -0700 MST package main import ( "fmt" "tim...

How to calculate CRC32 checksum in Python

Python Examples of zlib.crc32Cyclic redundancy check A cyclic redundancy check (CRC) is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to digital data. Using zlib.crc32 Function Computes a C...

How to use string constants in Python

String Constants Best Practice.String Constants in Python The constants defined in this module are: String constants: string.ascii_lettersThe concatenation of the ascii_lowercase and ascii_uppercase constants described below. This value is not locale...

How many keywords are there in Go

List of Golang Keywords. Keywords The following keywords are reserved and may not be used as identifiers. break default func interface select case defer go map struct chan else goto package switch const ...
Sambhav Khandelwal