File tree 2 files changed +6
-4
lines changed
en/guide/interview/golang/basic
guide/interview/golang/basic
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -559,7 +559,7 @@ The advantage of using pointer transfer is that it directly transfers the addres
559
559
560
560
### Golang Common String Concatenation Methods and Their Efficiency
561
561
562
- ::: details
562
+ ::: details Answer
563
563
564
564
| Method | Description |
565
565
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------- |
@@ -582,11 +582,13 @@ The advantage of using pointer transfer is that it directly transfers the addres
582
582
583
583
### What Are Tags Used for in Golang?
584
584
585
- ::: details
585
+ ::: details Answer
586
586
587
587
In Go, struct fields can have various custom tags. When parsing a struct, these tags can be extracted for convenient operations. Common tags include:
588
588
589
589
- ` json ` : Used to declare JSON serialization and deserialization operations, specifying fields and options.
590
590
- ` db ` : Primarily used for database field configuration, often in libraries like sqlx.
591
591
- ` form ` : Commonly used in web frameworks to declare form field bindings.
592
592
- ` validate ` : Frequently used for field validation rules by validators.
593
+
594
+ :::
Original file line number Diff line number Diff line change @@ -617,7 +617,7 @@ func main() {
617
617
618
618
### Golang 常见的字符串拼接方式有哪些?效率有何不同?
619
619
620
- ::: details
620
+ ::: details 答案
621
621
622
622
| 方法 | 描述 |
623
623
| ----------------- | ---------------------------------------------------------------------------------------------------------------------- |
@@ -640,7 +640,7 @@ func main() {
640
640
641
641
### Golang 中的 Tag 有什么用?
642
642
643
- ::: details
643
+ ::: details 答案
644
644
645
645
Golang 的结构体字段可以添加各类自定义的 ` Tag ` , 在解析结构体时可以使用函数将 ` Tag ` 解析出来,方便进行操作,常见的 ` Tag ` :
646
646
You can’t perform that action at this time.
0 commit comments