What does the '<<' operator do in Go when used with integers?
- Divides two integers
- Left shifts the bits of an integer
- Multiplies two integers
- Right shifts the bits of an integer
In Go, the '<<' operator performs a left shift operation on the bits of an integer. It moves each bit to the left by a specified number of positions, effectively multiplying the integer by 2 raised to the power of the shift count.
Loading...
Related Quiz
- Describe a scenario where using channels would be preferable over other synchronization mechanisms.
- In Go, the ________ interface allows you to define custom JSON marshaling and unmarshaling logic.
- What is the primary role of an HTTP handler in a Go web application?
- Consider a scenario where a function interacts with a database. How would you mock the database interactions for unit testing this function?
- Code coverage measures the extent to which your _______ is covered by your test suite.