当前位置: 首页 > news >正文

中国房地产未来走势谷歌优化师

中国房地产未来走势,谷歌优化师,展台设计展会展位设计,网站地图怎么弄定义说明 静态类型(static type):在编码时就能确定的类型,通过变量定义可以确定的类型;动态类型(concrete type):在运行时才能确定具体的数据类型; 动态静态类型如何理…

定义说明

  • 静态类型(static type):在编码时就能确定的类型,通过变量定义可以确定的类型;
  • 动态类型(concrete type):在运行时才能确定具体的数据类型;

动态静态类型如何理解?

go 语言中interface(any)可以承接所有类型的数据,所以这部分只有具体运行的时候,才能确定数据具体类型:

	var i interface{}var num int = 1var str string = "hello world"i = numi= str

在该示例中,第一行声明了一个interface的变量i,在编码时就可以确定了,所以i的静态类型就是interface;
同理,第二行num的静态类型为int,第三行str的静态类型为string
第四行,把num赋值给inum的实际类型是int, 所以此时,i的动态类型就是int
第五行,把str赋值给inum的实际类型是string,所以此时,i的动态类型就是string

Golang 中的interface的底层延申:

golang 中interface有两种含义/用法:

  1. 常规的接口类型,有一些带实现的接口定义
  2. 表示任意数据类型any

golang 的底层实现也是根据这两种情况做了不同的实现,底层分别对应ifaceeface

// 空接口结构
type eface struct {_type *_type			// 实体类型data  unsafe.Pointer	// 数据地址
}// 包含方法的结构
type iface struct {tab  *itab			// 接口和实体类型data unsafe.Pointer	// 数据地址
}type itab struct {inter *interfacetype_type *_typehash  uint32 // copy of _type.hash. Used for type switches._     [4]bytefun   [1]uintptr // variable sized. fun[0]==0 means _type does not implement inter.
}type interfacetype struct {typ     _typepkgpath namemhdr    []imethod
}type imethod struct {name nameOffityp typeOff
}type _type struct {size       uintptrptrdata    uintptr // size of memory prefix holding all pointershash       uint32tflag      tflagalign      uint8fieldAlign uint8kind       uint8// function for comparing objects of this type// (ptr to object A, ptr to object B) -> ==?equal func(unsafe.Pointer, unsafe.Pointer) bool// gcdata stores the GC type data for the garbage collector.// If the KindGCProg bit is set in kind, gcdata is a GC program.// Otherwise it is a ptrmask bitmap. See mbitmap.go for details.gcdata    *bytestr       nameOffptrToThis typeOff
}type nameOff int32
type typeOff int32
type tflag uint8
http://www.wooajung.com/news/27609.html

相关文章:

  • wordpress多站点支付插件泰州seo网站推广
  • 内蒙古做网站的公司百度爱采购竞价推广
  • 淄博政府网站建设公司怎么在百度上推广产品
  • 电子商务网站建设的目标网站seo公司哪家好
  • 1核1g服务器做网站企业网站设计
  • 众筹网站建设seo教程下载
  • 动漫做3d游戏下载网站有哪些百度推广靠谱吗
  • 如何把网站程序做授权网址访问怎样去推广自己的网店
  • 建设厅投诉网站首页商品推广软文写作500字
  • 政府网站集约化建设流程西安小程序开发的公司
  • 鞍山做网站或电商网站首页
  • 易尔通做网站怎么样建站流程
  • wordpress 禁止下载合肥seo优化公司
  • 淄博建设银行网站百度网页版怎么切换
  • wordpress腾讯云搭建网站什么是关键词举例说明
  • 网站建设和优化内容最重要投资网站建设方案
  • pathon做网站湖南竞价优化专业公司
  • 信息产业部 备案网站推广哪个平台好
  • wordpress站点更换域名中国软文网
  • 大连网站建设详细流程临沂网站建设
  • 制作一个网站要多少钱百度推广网站平台
  • 大连网站关键词排名网络推广怎么样
  • 深圳福田网站建设nba排名最新
  • 做毕业设计的网站设计广州的百度推广公司
  • 武汉最近新闻大事郑州seo培训
  • 目前安徽疫情最新情况短视频seo排名加盟
  • 开网店的企业名称重庆百度推广seo
  • 苹果cms如何做网站河南今日头条新闻最新
  • 网站自动登录怎么做苏州网站制作
  • 网站建设的电话客服网络seo是什么工作