jincheng9 / go-tutorial Goto Github PK
View Code? Open in Web Editor NEWGo learning materials,涵盖基础、中级和高级教程
Go learning materials,涵盖基础、中级和高级教程
res = add(a,b)
should be written as res := add(a,b)
希望可以出更多的rpc相关的文章
// changeArray无法改变实参数组的值
func changeArray(array [3]int) {
array[0] = 10
}
// changeArray2可以改变实参的值
func changeArray2(array *[3]int) {
array[0] = 10
}
// changeArray3可以改变实参的值
func changeArray3(array []int) {
array[0] = 10
}
// changeArray4可以改变实参的值==================补充一下
func changeArray4(array ...int) {
array[0] = 100
}
param := [3]int{1,2,3}
changeArray(param)
fmt.Println("param=", param) // param= [1 2 3]
changeArray2(¶m)
fmt.Println("param=", param) // param= [10 2 3]
sliceArray := []int{1,2,3}
changeArray3(sliceArray)
fmt.Println("sliceArray=", sliceArray) // sliceArray= [10 2 3]
changeArray4(sliceArray...)
fmt.Println("sliceArray=", sliceArray) // sliceArray= [100 2 3]
package main
import "fmt"
import "math"
// define function getSquareRoot1
func getSquareRoot1(x float64) float64 {
return math.Sqrt(x)
}
// deffine a function variable
var getSquareRoot2 = func(x float64) float64 {
return math.Sqrt(x)
}
// deffine a function variable ========================补充
var getSquareRoot3 = math.Sqrt
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.