Skip to content

Commit

Permalink
Merge pull request #14 from hespecial/dev
Browse files Browse the repository at this point in the history
fix formatting
  • Loading branch information
suyuan32 authored Jul 16, 2024
2 parents 3baf011 + c6647c4 commit 5bd4957
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/en/guide/interview/golang/basic/1-basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ The advantage of using pointer transfer is that it directly transfers the addres

### Golang Common String Concatenation Methods and Their Efficiency

::: details
::: details Answer

| Method | Description |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------- |
Expand All @@ -582,11 +582,13 @@ The advantage of using pointer transfer is that it directly transfers the addres

### What Are Tags Used for in Golang?

::: details
::: details Answer

In Go, struct fields can have various custom tags. When parsing a struct, these tags can be extracted for convenient operations. Common tags include:

- `json`: Used to declare JSON serialization and deserialization operations, specifying fields and options.
- `db`: Primarily used for database field configuration, often in libraries like sqlx.
- `form`: Commonly used in web frameworks to declare form field bindings.
- `validate`: Frequently used for field validation rules by validators.

:::
4 changes: 2 additions & 2 deletions src/guide/interview/golang/basic/1-basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ func main() {

### Golang 常见的字符串拼接方式有哪些?效率有何不同?

::: details
::: details 答案

| 方法 | 描述 |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------- |
Expand All @@ -640,7 +640,7 @@ func main() {

### Golang 中的 Tag 有什么用?

::: details
::: details 答案

Golang 的结构体字段可以添加各类自定义的 `Tag`, 在解析结构体时可以使用函数将 `Tag` 解析出来,方便进行操作,常见的 `Tag`:

Expand Down

0 comments on commit 5bd4957

Please sign in to comment.