Browse Source

demo程序

master
viviman 3 years ago
parent
commit
153ef902eb
  1. 21
      golang_learn/data_func/go_to_main/main.exe.manifest
  2. 39
      golang_learn/data_func/go_to_main/main.go
  3. BIN
      golang_learn/data_func/go_to_main/main.syso
  4. BIN
      golang_learn/data_func/go_to_main/rc.ico

21
golang_learn/data_func/go_to_main/main.exe.manifest

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="x86"
name="controls"
type="win32"
></assemblyIdentity>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
></assemblyIdentity>
</dependentAssembly>
</dependency>
</assembly>

39
golang_learn/data_func/go_to_main/main.go

@ -0,0 +1,39 @@
package main
import (
"encoding/hex"
"fmt"
)
func main() {
fmt.Println("\n ================== 基础类型 = 开始 ================== ")
boolvar := true
fmt.Println("布尔\t boolvar = ", boolvar)
var intvar int
fmt.Println("整形\t intvar = ", intvar)
var float32var float32
fmt.Println("浮点型\t float32var = ", float32var)
var bytevar byte
bytevar = 'a'
fmt.Println("字符\t bytevar = ", bytevar)
var int32 byte
int32 = 0x31
//int32 = int32+1
fmt.Println("16进制数值\t int32 = ", int32)
// 注意"Hello"与"encodedStr"不相等,encodedStr是用字符串来表示16进制
src := []byte("Hello")
// [72 101 108 108 111]
fmt.Println("16进制Hex\t src = ", src)
// 48656c6c6f -> 48(4*16+8=72) 65(6*16+5=101) 6c 6c 6f
encodedStr := hex.EncodeToString(src)
fmt.Println("16进制Hex\t encodedStr = ", encodedStr)
intcodedStr := hex.EncodeToString([]byte("192.168.1.123"))
fmt.Println("16进制Hex\t intcodedStr = ", intcodedStr)
}

BIN
golang_learn/data_func/go_to_main/main.syso

Binary file not shown.

BIN
golang_learn/data_func/go_to_main/rc.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 KiB

Loading…
Cancel
Save