This is a new function added in the go1.21 standard library, which can make the code more concise and easy to read.
The specific code is similar to https://github.com/cosmos/ibc-go/pull/7833/files.
If this issue can be approved by the maintainer, I would be happy to find such optimizations for all go projects under the cosmos organization.