Add Add en/0.2.3.md syntax highlighting
This commit is contained in:
17
en/02.2.md
17
en/02.2.md
@@ -84,14 +84,15 @@ More examples.
|
||||
|
||||
In Go, we use `bool` to define a variable as boolean type, the value can only be `true` or `false`, and `false` will be the default value. ( ***You cannot convert variables' type between number and boolean!*** )
|
||||
```Go
|
||||
// sample code
|
||||
var isActive bool // global variable
|
||||
var enabled, disabled = true, false // omit type of variables
|
||||
func test() {
|
||||
var available bool // local variable
|
||||
valid := false // brief statement of variable
|
||||
available = true // assign value to variable
|
||||
}
|
||||
// sample code
|
||||
var isActive bool // global variable
|
||||
var enabled, disabled = true, false // omit type of variables
|
||||
|
||||
func test() {
|
||||
var available bool // local variable
|
||||
valid := false // brief statement of variable
|
||||
available = true // assign value to variable
|
||||
}
|
||||
```
|
||||
### Numerical types
|
||||
|
||||
|
||||
Reference in New Issue
Block a user