Add Golang syntax highlighting to README docs (#317)
This commit is contained in:
parent
ad12a30dae
commit
672a1bc9e7
@ -2330,7 +2330,7 @@ with <code>var x int = 2</code> we are setting the variable type to integer whil
|
|||||||
<details>
|
<details>
|
||||||
<summary>下面代码块有什么问题? 怎么解决?
|
<summary>下面代码块有什么问题? 怎么解决?
|
||||||
|
|
||||||
```
|
```go
|
||||||
func main() {
|
func main() {
|
||||||
var x float32 = 13.5
|
var x float32 = 13.5
|
||||||
var y int
|
var y int
|
||||||
@ -2343,7 +2343,7 @@ func main() {
|
|||||||
<details>
|
<details>
|
||||||
<summary>下面的代码块尝试将整数101转换为字符串,但相反,我们得到“ e”。 这是为什么? 怎么解决?
|
<summary>下面的代码块尝试将整数101转换为字符串,但相反,我们得到“ e”。 这是为什么? 怎么解决?
|
||||||
|
|
||||||
```
|
```go
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
@ -2379,7 +2379,7 @@ func main() {
|
|||||||
<details>
|
<details>
|
||||||
<summary>以下代码块的输出是什么?:
|
<summary>以下代码块的输出是什么?:
|
||||||
|
|
||||||
```
|
```go
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
@ -2406,7 +2406,7 @@ func main() {
|
|||||||
<details>
|
<details>
|
||||||
<summary>以下代码块的输出是什么?:
|
<summary>以下代码块的输出是什么?:
|
||||||
|
|
||||||
```
|
```go
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
13
README.md
13
README.md
@ -966,7 +966,8 @@ func main() {
|
|||||||
<details>
|
<details>
|
||||||
<summary>The following block of code tries to convert the integer 101 to a string but instead we get "e". Why is that? How to fix it?
|
<summary>The following block of code tries to convert the integer 101 to a string but instead we get "e". Why is that? How to fix it?
|
||||||
|
|
||||||
```
|
|
||||||
|
```go
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
@ -1007,7 +1008,7 @@ But `x`, `y` and their sum is variable.
|
|||||||
<details>
|
<details>
|
||||||
<summary>What will be the output of the following block of code?:
|
<summary>What will be the output of the following block of code?:
|
||||||
|
|
||||||
```
|
```go
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
@ -1045,7 +1046,7 @@ It is called the [blank identifier](https://golang.org/doc/effective_go.html#bla
|
|||||||
<details>
|
<details>
|
||||||
<summary>What will be the output of the following block of code?:
|
<summary>What will be the output of the following block of code?:
|
||||||
|
|
||||||
```
|
```go
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
@ -1067,7 +1068,7 @@ Since the first iota is declared with the value `3` (` + 3`), the next one has t
|
|||||||
<details>
|
<details>
|
||||||
<summary>What will be the output of the following block of code?:
|
<summary>What will be the output of the following block of code?:
|
||||||
|
|
||||||
```
|
```go
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@ -1106,7 +1107,7 @@ Output: 2 1 3
|
|||||||
<details>
|
<details>
|
||||||
<summary>What will be the output of the following block of code?:
|
<summary>What will be the output of the following block of code?:
|
||||||
|
|
||||||
```
|
```go
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@ -1160,7 +1161,7 @@ But in `mod2`, `append` creats new slice, and we're changing only `a` value, not
|
|||||||
<details>
|
<details>
|
||||||
<summary>What will be the output of the following block of code?:
|
<summary>What will be the output of the following block of code?:
|
||||||
|
|
||||||
```
|
```go
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
Loading…
Reference in New Issue
Block a user