1 Star 0 Fork 0

R.Z.P/go-example

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.go 12.06 KB
一键复制 编辑 原始数据 按行查看 历史
rzp 提交于 2024-08-23 16:27 . first commit -n
/**
*
* File Name: main.go
* Author: rzp
* Mail: zhenpengr@jumei.com
* Created Time: 五 8/ 9 11:34:58 2024
*/
package main
import (
"share/src/01data_type"
"share/src/02var_const"
"share/src/03array"
"share/src/04slice"
"share/src/05map"
"share/src/06struct"
"share/src/07pointer"
"share/src/08control"
"share/src/09function"
"share/src/10method"
"share/src/11interface"
"share/src/12err"
"share/src/13reflect"
"share/src/14package"
"share/src/15goroutine"
"share/src/16channel"
"share/src/17waitgroup"
"share/src/18select"
"share/src/19concurrent"
"share/src/20web"
)
func showDataType() {
println("hello world")
println("---------------------------------------")
_1data_type.ShowInteger()
println("---------------------------------------")
_1data_type.ShowUnsignedInteger()
println("---------------------------------------")
_1data_type.ShowFloat()
println("---------------------------------------")
_1data_type.ShowChar()
println("---------------------------------------")
_1data_type.ShowCharSize()
println("---------------------------------------")
_1data_type.ShowString()
println("---------------------------------------")
_1data_type.ShowBool()
println("---------------------------------------")
_1data_type.ShowComplex()
println("---------------------------------------")
}
func showVarConst() {
_2var_const.ShowVarWithKeywords()
println("---------------------------------------")
_2var_const.ShowVar1()
println("---------------------------------------")
_2var_const.ShowVar2()
println("---------------------------------------")
_2var_const.ShowVar3()
println("---------------------------------------")
_2var_const.ShowVar4()
println("---------------------------------------")
_2var_const.ShowVar5()
println("---------------------------------------")
_2var_const.ShowConst()
println("---------------------------------------")
_2var_const.ShowConstEnum()
println("---------------------------------------")
_2var_const.ShowConstIota()
println("---------------------------------------")
_2var_const.ShowConstIotaWithExpression()
println("---------------------------------------")
_2var_const.ShowConstIotaWithExpression1()
println("---------------------------------------")
}
func showArray() {
_3array.ShowNoInitArray()
println("---------------------------------------")
_3array.ShowInitArray()
println("---------------------------------------")
_3array.ShowDiffArray()
println("---------------------------------------")
_3array.ShowMultiArray()
println("---------------------------------------")
_3array.ShowArrayLength()
println("---------------------------------------")
_3array.ShowIterArray()
println("---------------------------------------")
_3array.ShowCopyArrayByValue()
println("---------------------------------------")
}
func showSlice() {
_4slice.ShowNilSlice()
println("---------------------------------------")
_4slice.ShowEmptySlice()
println("---------------------------------------")
_4slice.ShowMakeSlice()
println("---------------------------------------")
_4slice.ShowSliceFromArray()
println("---------------------------------------")
_4slice.ShowSliceCapAndLen()
println("---------------------------------------")
//src.ShowOverflowSlice()
println("---------------------------------------")
_4slice.ShowModifySlice()
println("---------------------------------------")
_4slice.ShowAppendSlice()
println("---------------------------------------")
_4slice.ShowMultiSlice()
println("---------------------------------------")
}
func showMap() {
_5map.ShowCreateMap()
println("---------------------------------------")
_5map.ShowCreateLiteralMap()
println("---------------------------------------")
_5map.ShowOpMap()
println("---------------------------------------")
_5map.ShowReferenceMap()
println("---------------------------------------")
}
func showStruct() {
_6struct.ShowCreateNamedStruct()
println("---------------------------------------")
_6struct.ShowCreateNoNamedStruct()
println("---------------------------------------")
_6struct.ShowZeroStruct()
println("---------------------------------------")
_6struct.ShowInitStruct()
println("---------------------------------------")
_6struct.ShowStructFields()
println("---------------------------------------")
_6struct.ShowAssignStruct()
println("---------------------------------------")
_6struct.ShowStructPointer()
println("---------------------------------------")
_6struct.ShowStructAnonymousFields()
println("---------------------------------------")
_6struct.ShowNestedStruct()
println("---------------------------------------")
_6struct.ShowAnonymousNestedStruct()
println("---------------------------------------")
_6struct.ShowStructCompare()
println("---------------------------------------")
_6struct.ShowStructBook()
println("---------------------------------------")
_6struct.ShowStructToJson()
println("---------------------------------------")
_6struct.ShowJsonToStruct()
println("---------------------------------------")
_6struct.ShowStructTag()
println("---------------------------------------")
}
func showPointer() {
_7pointer.ShowCreatePointer1()
println("---------------------------------------")
_7pointer.ShowCreatePointer2()
println("---------------------------------------")
_7pointer.ShowCreatePointer3()
println("---------------------------------------")
_7pointer.ShowPointerOperator()
println("---------------------------------------")
_7pointer.ShowPointerType()
println("---------------------------------------")
_7pointer.ShowPointerZeroValue()
println("---------------------------------------")
_7pointer.ShowPointerAsArguments()
println("---------------------------------------")
_7pointer.ShowPointerAndSlice()
println("---------------------------------------")
_7pointer.ShowPointerOperation()
println("---------------------------------------")
}
func showControl() {
_8control.ShowSwitchCase()
println("---------------------------------------")
_8control.ShowForLoop()
println("---------------------------------------")
}
func ShowFunction() {
_9function.ShowFunctionDefinition()
println("---------------------------------------")
_9function.ShowMultiSameTypeFunction()
println("---------------------------------------")
_9function.ShowMultiDiffTypeFunction()
println("---------------------------------------")
_9function.ShowResolveSequence()
println("---------------------------------------")
_9function.ShowFunctionReturnValue()
println("---------------------------------------")
_9function.ShowFunctionNamedReturnValue()
println("---------------------------------------")
_9function.ShowFunctionWithDefer()
println("---------------------------------------")
_9function.ShowFunctionDeferVariable()
println("---------------------------------------")
_9function.ShowFunctionDeferMethod()
println("---------------------------------------")
_9function.ShowFunctionWithDeferStack()
println("---------------------------------------")
_9function.ShowFunctionWithReturnDefer()
println("---------------------------------------")
}
func showMethod() {
_0method.ShowMethod1()
println("---------------------------------------")
_0method.ShowMethod2()
println("---------------------------------------")
_0method.ShowIntMethod()
println("---------------------------------------")
}
func showInterface() {
_1interface.ShowInterfaceImplement()
println("---------------------------------------")
_1interface.ShowInterfacePolymorphism()
println("---------------------------------------")
_1interface.ShowInterfaceTypeAndValue()
println("---------------------------------------")
_1interface.ShowEmptyInterface()
println("---------------------------------------")
_1interface.ShowInterfaceContainerVariables()
println("---------------------------------------")
_1interface.ShowInterfaceAssert()
println("---------------------------------------")
_1interface.ShowInterfaceSwitchCase()
println("---------------------------------------")
_1interface.ShowInterfaceMultiImplement()
println("---------------------------------------")
_1interface.ShowInterfaceNested()
println("---------------------------------------")
}
func showErr() {
_2err.ShowErrFileNotExist()
println("---------------------------------------")
_2err.ShowCustomCreateErr()
println("---------------------------------------")
_2err.ShowErrorMoreInfo()
println("---------------------------------------")
//src.ShowPanic()
println("---------------------------------------")
//src.ShowPanicDefer()
println("---------------------------------------")
_2err.ShowPanicRecover()
println("---------------------------------------")
}
func showReflect() {
_3reflect.ShowReflectType()
println("---------------------------------------")
_3reflect.ShowReflectValue()
println("---------------------------------------")
_3reflect.ShowReflectKind()
println("---------------------------------------")
_3reflect.ShowReflectNumField()
println("---------------------------------------")
_3reflect.ShowReflectField()
println("---------------------------------------")
}
func showPackage() {
_4package.ShowPackage()
println("---------------------------------------")
_4package.ShowPackageLibs()
println("---------------------------------------")
_4package.ShowPackageInit()
println("---------------------------------------")
}
func showGoroutine() {
_5goroutine.ShowGoroutineCreate()
println("---------------------------------------")
_5goroutine.ShowCreateMultiGoroutine()
println("---------------------------------------")
}
func showChannel() {
_6channel.ShowChannelCreate()
println("---------------------------------------")
_6channel.ShowChannelResultValue()
println("---------------------------------------")
_6channel.ShowChannelLenAndCap()
println("---------------------------------------")
_6channel.ShowSingleChannel()
println("---------------------------------------")
_6channel.ShowIterChannel()
println("---------------------------------------")
_6channel.ShowChannelAsLock()
println("---------------------------------------")
_6channel.ShowChannelDeadLock()
println("---------------------------------------")
_6channel.ShowBufferedChannelDeadLock()
println("---------------------------------------")
}
func showWaitGroup() {
_7waitgroup.ShowGoroutineExitByChannel()
println("---------------------------------------")
_7waitgroup.ShowSyncWaitGroup()
println("---------------------------------------")
}
func showSelect() {
_8select.ShowChannelSelectCase()
println("---------------------------------------")
_8select.ShowSelectMultiTask()
println("---------------------------------------")
//src.ShowSelectDeadLock()
println("---------------------------------------")
_8select.ShowEmptySelect()
println("---------------------------------------")
_8select.ShowSelectTimeout()
println("---------------------------------------")
_8select.ShowSelectReadAndWriteChannel()
println("---------------------------------------")
}
func showConcurrent() {
_9concurrent.ShowConcurrentBase()
println("---------------------------------------")
_9concurrent.ShowConcurrentCriticalSection()
println("---------------------------------------")
_9concurrent.ShowConcurrentMutex()
println("---------------------------------------")
_9concurrent.ShowConcurrentRWriteMutex()
println("---------------------------------------")
_9concurrent.ShowConcurrentSyncCond()
println("---------------------------------------")
}
func showWebServer() {
_0web.ShowWebServer()
println("---------------------------------------")
_0web.ShowGinFrameWork()
println("---------------------------------------")
_0web.ShowDatabaseORM()
println("---------------------------------------")
_0web.ShowWebTemplate()
println("---------------------------------------")
}
func main() {
showDataType()
//showVarConst()
//showArray()
//showSlice()
//showMap()
//showStruct()
//showPointer()
//showControl()
//ShowFunction()
//showMethod()
//showInterface()
//showErr()
//showReflect()
//showPackage()
//showGoroutine()
//showChannel()
//showWaitGroup()
//showSelect()
//showConcurrent()
//showWebServer()
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/jasonRzp/go-example.git
git@gitee.com:jasonRzp/go-example.git
jasonRzp
go-example
go-example
master

搜索帮助