-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e43897b
commit bc20062
Showing
57 changed files
with
791 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIDizCCAnMCCQD8nJ7qB1LAwTANBgkqhkiG9w0BAQsFADBxMQswCQYDVQQGEwJD | ||
TjELMAkGA1UECAwCQkoxCzAJBgNVBAcMAkJKMQwwCgYDVQQKDANDT00xDDAKBgNV | ||
BAsMA05TUDELMAkGA1UEAwwCQ0ExHzAdBgkqhkiG9w0BCQEWEHlvdXJlbWFpbEBx | ||
cS5jb20wHhcNMjIwMjA3MTI0MTMzWhcNMjMwMjA3MTI0MTMzWjCBnTELMAkGA1UE | ||
BhMCQ04xEDAOBgNVBAgMB0JlaWppbmcxEDAOBgNVBAcMB0JlaWppbmcxIDAeBgNV | ||
BAoMF1dlaTY0IChCZWlqaW5nKSBMaW1pdGVkMQwwCgYDVQQLDANDRUQxGTAXBgNV | ||
BAMMECouemhhb3dlaWd1by5jb20xHzAdBgkqhkiG9w0BCQEWEHlvdXJlbWFpbEBx | ||
cS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDue2hNvi5tkGC7 | ||
0YuUpK3sbYUz8HxsbvmUX706d+aRQdgSuH9bzWW5XtzWn/8SgtRxWTnYeaGqf6zp | ||
xrX5NQXpW01so/nunsj8dbTbhiHin2yJZ20BM3Xi2IhnV+X7CubTjGBvi6mqdHZM | ||
Tjkemj+cqP1mD9GUK66Ny7ksmjkZ31nlD6ddaKkdv8TtkMeUgEFdVsScmt/eSxSq | ||
whjwTHYfB+LMXdjwZxJWFevVhsUuqz41eRAFOB2ZX5A0da9HsEuX9lG17dDKBoKI | ||
ik3UX9nggqVArW7Hme2r9egEjiWlJxGEekAWJwxZx5JUlkPddA0K71n9twcqcp8N | ||
WoXbdoJ1AgMBAAEwDQYJKoZIhvcNAQELBQADggEBAGVAq7IvZteE2WeF2KpaImqW | ||
CtYC3PcSgD84Pbh7Phvkl0iY5vFJvsdS5boLr89+RW9zrSoS4PkEa3vBscAwcdZg | ||
vzg9hOviceHvN8V7mCsd2VLuL9dvNVc+tt2PQtrDyN12L9uFJMZtl8wf9s8Zz2E1 | ||
l40iKa0zF6yPcwxP0ERt8vQKtUq5TsdQHgy7L6ajwVgBy9MTUAzo7zceEUaPfzV9 | ||
kvBMYBoDCrkJc1qbXDeuX9qvG+SJ1+nPkAiksvM79O/kmlo0l6NO8tZuv1wR5Wd+ | ||
MTi8trPykiiSBuQGWRxTYxoLyGLL5Mg8DEkVSYS+ypiFmWioJ5n5Zr+FbzBkkc0= | ||
-----END CERTIFICATE----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
-----BEGIN RSA PRIVATE KEY----- | ||
MIIEpAIBAAKCAQEA7ntoTb4ubZBgu9GLlKSt7G2FM/B8bG75lF+9OnfmkUHYErh/ | ||
W81luV7c1p//EoLUcVk52Hmhqn+s6ca1+TUF6VtNbKP57p7I/HW024Yh4p9siWdt | ||
ATN14tiIZ1fl+wrm04xgb4upqnR2TE45Hpo/nKj9Zg/RlCuujcu5LJo5Gd9Z5Q+n | ||
XWipHb/E7ZDHlIBBXVbEnJrf3ksUqsIY8Ex2HwfizF3Y8GcSVhXr1YbFLqs+NXkQ | ||
BTgdmV+QNHWvR7BLl/ZRte3QygaCiIpN1F/Z4IKlQK1ux5ntq/XoBI4lpScRhHpA | ||
FicMWceSVJZD3XQNCu9Z/bcHKnKfDVqF23aCdQIDAQABA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+mi/R2py4vMMkRLAYX6s79BAu1ntQH6+9pvGsTBM | ||
wUbDNnkCgYB1Bl+DZSoldvR1SQyvrzv9Gh5fBTPV0EZZoXpjQbA1HrrhyvlISIyT | ||
K4HWpHFX/uAuLaoBOi5bWZ4NHJqSZGBxKNIqa7Fv2NYwKkj80aiB6moEgN990C5m | ||
uk15jO/1GF7kerEcDRoP7kWgPhe5gU4NVinZskcTGQrgO8NyLrAHPg== | ||
-----END RSA PRIVATE KEY----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module github.com/zhaoweiguo/demo-go/github.com/gin-gonic/gin | ||
|
||
go 1.16 | ||
|
||
require github.com/gin-gonic/gin v1.8.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
|
||
Install using go get github.com/klauspost/crc32. This library is based on Go 1.5 code and requires Go 1.3 or newer. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/lucas-clemente/quic-go/http3" | ||
"net/http" | ||
) | ||
|
||
func main() { | ||
http.Handle("/", http.FileServer(http.Dir("."))) | ||
http3.ListenAndServeQUIC("localhost:4242", "./asserts/cert/server.crt", "./asserts/cert/server_key.pem", nil) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module github.com/zhaoweiguo/demo-go/github.com/yuin | ||
|
||
go 1.16 | ||
|
||
require github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module github.com/zhaoweiguo/demo-go/github.com/yuin/gopher-lua/demo-file | ||
|
||
go 1.16 | ||
|
||
require github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
print("hello world! ..") | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package main | ||
|
||
import ( | ||
lua "github.com/yuin/gopher-lua" | ||
) | ||
|
||
func main() { | ||
L := lua.NewState() | ||
defer L.Close() | ||
if err := L.DoFile("./hello.lua"); err != nil { | ||
panic(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
print("hello world") | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package demo | ||
|
||
import ( | ||
"fmt" | ||
lua "github.com/yuin/gopher-lua" | ||
"testing" | ||
) | ||
|
||
var ( | ||
L *lua.LState | ||
) | ||
|
||
func init() { | ||
L = lua.NewState() | ||
} | ||
|
||
func TestNormal(t *testing.T) { | ||
defer L.Close() | ||
if err := L.DoString(`print("hello")`); err != nil { | ||
panic(err) | ||
} | ||
} | ||
|
||
func TestString(t *testing.T) { | ||
defer L.Close() | ||
lv := L.Get(-1) // get the value at the top of the stack | ||
if str, ok := lv.(lua.LString); ok { | ||
// lv is LString | ||
fmt.Println(string(str)) | ||
} | ||
fmt.Println(lv) | ||
if lv.Type() != lua.LTString { | ||
panic("string required.") | ||
} | ||
} | ||
|
||
func TestFile(t *testing.T) { | ||
defer L.Close() | ||
if err := L.DoFile("hello.lua"); err != nil { | ||
panic(err) | ||
} | ||
} | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package array | ||
|
||
import ( | ||
"log" | ||
"testing" | ||
) | ||
|
||
func init() { | ||
log.SetFlags(log.Lshortfile) | ||
} | ||
|
||
|
||
func TestIndex(t *testing.T) { | ||
str := "0123456789" | ||
log.Println(str[:]) // 0123456789 | ||
log.Println(str[0:]) // 0123456789 | ||
log.Println(str[1:]) // 123456789 | ||
log.Println(str[:1]) // 0 | ||
log.Println(str[0:9]) // 012345678 | ||
log.Println(str[0:10]) // 0123456789 | ||
log.Println(str[2:5]) // 234 | ||
} | ||
|
||
func TestRange1(t *testing.T) { | ||
var myArray [5]int = [5]int{1, 2, 3, 4, 5} | ||
var mySlice []int = myArray[:3] | ||
|
||
// result: 1 2 3 4 5 | ||
for _, v := range myArray { // _:索引, v:数组值 | ||
log.Print(v, "") | ||
} | ||
log.Println() | ||
// result: 1 2 3 | ||
for _, v := range mySlice { | ||
log.Print(v, "") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.