Skip to content

Commit ea20aea

Browse files
committed
Fix example
1 parent f25c50a commit ea20aea

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

examples/basic/bitop/bitop_basic.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,27 +55,28 @@ func Basic() error {
5555
output.StdoutHr()
5656

5757
// 特定のビットが立っているか検査
58+
//goland:noinspection GoBoolExpressions
5859
if x&(1<<5) != 0 {
5960
output.Stdoutl("[x&(1<<5)]", "ON")
6061
}
6162

6263
output.StdoutHr()
6364

6465
// 特定のビットを落とす
65-
x &^= (1 << 5)
66-
output.Stdoutf("[x &^= (1 << 5)]", "%08b\n", x)
66+
x &^= 1 << 5
67+
output.Stdoutf("[x &^= 1 << 5]", "%08b\n", x)
6768

6869
// 特定のビットを立てる
69-
x |= (1 << 5)
70-
output.Stdoutf("[x |= (1 << 5)]", "%08b\n", x)
70+
x |= 1 << 5
71+
output.Stdoutf("[x |= 1 << 5]", "%08b\n", x)
7172

7273
output.StdoutHr()
7374

7475
// 特定のビットをトグル
75-
x ^= (1 << 7)
76-
output.Stdoutf("[x ^= (1 << 7)]", "%08b\n", x)
77-
x ^= (1 << 7)
78-
output.Stdoutf("[x ^= (1 << 7)]", "%08b\n", x)
76+
x ^= 1 << 7
77+
output.Stdoutf("[x ^= 1 << 7]", "%08b\n", x)
78+
x ^= 1 << 7
79+
output.Stdoutf("[x ^= 1 << 7]", "%08b\n", x)
7980

8081
output.StdoutHr()
8182

0 commit comments

Comments
 (0)