semi-xi / goblog Goto Github PK
View Code? Open in Web Editor NEWgo的记录
go的记录
var a = 1
getPrt(&a)
func getPrt(ptr *int) {
println(ptr)
}
实际上输出是一个地址
type Book struct {
title string
}
func getBookInfo(ptr *Book) {
println("title", ptr.title)
println("prt", ptr)
}
p := Book{title: "BookName"}
getBookInfo(&p)
第1个输出是BookName,第2个值输出是一个地址。可以确认的是如果指针指向的是那个变量,那个变量的直接输出就是一个内存地址,对于结构体来说,哪怕是拿变量的地址去获取值,结果获取出来的也是一个具体的值
同一个目录下的package name 必须是同一个
utils
-a.go
-b.go
a、b2个文件的开头都必须是相同的package neme
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.