当前位置:网站首页>Talking about the struct of go
Talking about the struct of go
2022-06-30 06:01:00 【Flower master】
Always thought that struct It is used to store data , Until today, when writing code ,goland Give me a hint

f That's what we usually say field
m Namely method.
Think about the classes we usually write , Isn't it just a class ? It's just god The encapsulation of is based on the case of the initial letter . also init() It can also be seen as __construct() Initialize things ( This description is not very accurate , stay go It's all about &struct{} To initialize .)
<?php
class A {
protected $a;
public function aaa(){
}
}
?>
边栏推荐
- MySQL数据库用户管理
- [GPU] basic operation
- 领导:谁再用 Redis 过期监听实现关闭订单,立马滚蛋!
- 旋转标注工具roLabelImg
- Attempt to redefine 'timeout' at line 2 solution
- 1380. lucky numbers in matrices
- [deep learning] data segmentation
- 谁不想要一个自己的博客网站呢 - 搭建博客网站wordpress
- UE4_ Editor UMG close window cannot destroy UMG immediately
- 从零开发 stylelint规则(插件)
猜你喜欢

English grammar_ Adjective / adverb Level 3 - superlative

Projet Web de déploiement du serveur Cloud

Develop stylelint rules from zero (plug-ins)

MySQL advanced SQL statement

Tornado frame foundation

Voting vault: a new primitive for defi and Governance
![[chestnut sugar GIS] global mapper - how to assign the elevation value of the grid to the point](/img/bb/ea0e78065ba54ff253995faeeb6901.png)
[chestnut sugar GIS] global mapper - how to assign the elevation value of the grid to the point

如何制作CSR(Certificate Signing Request)文件?

电脑查看WiFi使用密码

UE4_ Editor UMG close window cannot destroy UMG immediately
随机推荐
Cisco vxlan configuration
STM32F103 series controlled OLED IIC 4-pin
MySQL storage system
What indicators should safety service engineers pay attention to in emergency response?
General contents of learning reinforcement learning
电脑查看WiFi使用密码
Create uiactionsheet [duplicate] - creating uiactionsheet [duplicate]
Here comes the nearest chance to Ali
ES6箭头函数
Sword finger offer 18 Delete the node of the linked list
二十四、输入输出设备模型(串口/键盘/磁盘/打印机/总线/中断控制器/DMA和GPU)
Configure the user to log in to the device through telnet -- AAA local authentication
[MD editing required] welcome to the CSDN markdown editor
MySQL index
How to print pthread_ t - How to print pthread_ t
CompletionService使用及原理(源码分析)
Shenzhou ares tx6 boot logo modification tutorial
Es6数组
Today, Ali came out with 35K. It's really sandpaper that wiped my ass. it showed me my hand
ES6解构赋值