Skip to content

Commit cc42bcd

Browse files
committed
fix comments
1 parent e07c9c3 commit cc42bcd

File tree

26 files changed

+102
-101
lines changed

26 files changed

+102
-101
lines changed

cert_util/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
lua "github.com/yuin/gopher-lua"
1111
)
1212

13-
// NotAfter(): lua cert.not_after(hostname, <ip>) returns (unixts cert_not_after, err)
13+
// NotAfter lua cert.not_after(hostname, <ip>) returns (unixts cert_not_after, err)
1414
func NotAfter(L *lua.LState) int {
1515
serverName, address := L.CheckString(1), ""
1616
if L.GetTop() > 1 {

cmd/api.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import (
1212
)
1313

1414
const (
15-
// default execution timeout in seconds
15+
//Timeout default execution timeout in seconds
1616
Timeout = 10
1717
)
1818

19-
// Exec(): lua cmd.exec(command) return ({status=0, stdout="", stderr=""}, err)
19+
// Exec lua cmd.exec(command) return ({status=0, stdout="", stderr=""}, err)
2020
func Exec(L *lua.LState) int {
2121
command := L.CheckString(1)
2222
timeout := time.Duration(L.OptInt64(2, Timeout)) * time.Second

crypto/api.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ import (
99
lua "github.com/yuin/gopher-lua"
1010
)
1111

12-
// MD5(): lua crypto.md5(string) return string
12+
// MD5 lua crypto.md5(string) return string
1313
func MD5(L *lua.LState) int {
1414
str := L.CheckString(1)
1515
hash := md5.Sum([]byte(str))
1616
L.Push(lua.LString(fmt.Sprintf("%x", hash)))
1717
return 1
1818
}
1919

20-
// SHA256(): lua crypto.sha256(string) return string
20+
// SHA256 lua crypto.sha256(string) return string
2121
func SHA256(L *lua.LState) int {
2222
str := L.CheckString(1)
2323
hash := sha256.Sum256([]byte(str))

db/api.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var (
3636
sharedDBLock = &sync.Mutex{}
3737
)
3838

39-
// RegisterDriver(): register sql driver
39+
// RegisterDriver register sql driver
4040
func RegisterDriver(driver string, i luaDB) {
4141
knownDriversLock.Lock()
4242
defer knownDriversLock.Unlock()
@@ -53,7 +53,7 @@ func checkDB(L *lua.LState, n int) luaDB {
5353
return nil
5454
}
5555

56-
// Open(): lua db.open(driver, connection_string, config) returns (db_ud, err)
56+
// Open lua db.open(driver, connection_string, config) returns (db_ud, err)
5757
// config table:
5858
// {
5959
// shared=false,
@@ -116,7 +116,7 @@ func Open(L *lua.LState) int {
116116
return 1
117117
}
118118

119-
// Query(): lua db_ud:query(query) returns ({rows = {}, columns = {}}, err)
119+
// Query lua db_ud:query(query) returns ({rows = {}, columns = {}}, err)
120120
func Query(L *lua.LState) int {
121121
dbInterface := checkDB(L, 1)
122122
query := L.CheckString(2)
@@ -149,7 +149,7 @@ func Query(L *lua.LState) int {
149149
return 1
150150
}
151151

152-
// Exec(): lua db_ud:exec(query) returns ({rows_affected=number, last_insert_id=number}, err)
152+
// Exec lua db_ud:exec(query) returns ({rows_affected=number, last_insert_id=number}, err)
153153
func Exec(L *lua.LState) int {
154154
dbInterface := checkDB(L, 1)
155155
query := L.CheckString(2)
@@ -179,7 +179,7 @@ func Exec(L *lua.LState) int {
179179
return 1
180180
}
181181

182-
// Command(): lua db_ud:command(query) returns ({rows = {}, columns = {}}, err)
182+
// Command lua db_ud:command(query) returns ({rows = {}, columns = {}}, err)
183183
func Command(L *lua.LState) int {
184184
dbInterface := checkDB(L, 1)
185185
query := L.CheckString(2)
@@ -204,7 +204,7 @@ func Command(L *lua.LState) int {
204204
return 1
205205
}
206206

207-
// Close(): lua db_ud:close() returns err
207+
// Close lua db_ud:close() returns err
208208
func Close(L *lua.LState) int {
209209
dbIface := checkDB(L, 1)
210210
if err := dbIface.closeDB(); err != nil {

db/api_stmt.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type luaStmt struct {
1111
d *sql.DB
1212
}
1313

14-
// Stmt(): lua db_ud:stmt(query) returns (stmt_ud, err)
14+
// Stmt lua db_ud:stmt(query) returns (stmt_ud, err)
1515
func Stmt(L *lua.LState) int {
1616
dbInterface := checkDB(L, 1)
1717
query := L.CheckString(2)
@@ -43,7 +43,7 @@ func getSTMTArgs(L *lua.LState) []interface{} {
4343
return args
4444
}
4545

46-
// StmtQuery(): lua stmt_ud:query(args) returns ({rows = {}, columns = {}}, err)
46+
// StmtQuery lua stmt_ud:query(args) returns ({rows = {}, columns = {}}, err)
4747
func StmtQuery(L *lua.LState) int {
4848
ud := L.CheckUserData(1)
4949
s, ok := ud.Value.(*luaStmt)
@@ -71,7 +71,7 @@ func StmtQuery(L *lua.LState) int {
7171
return 1
7272
}
7373

74-
// StmtExec(): lua stmt_ud:exec(args) returns ({rows_affected=number, last_insert_id=number}, err)
74+
// StmtExec lua stmt_ud:exec(args) returns ({rows_affected=number, last_insert_id=number}, err)
7575
func StmtExec(L *lua.LState) int {
7676
ud := L.CheckUserData(1)
7777
s, ok := ud.Value.(*luaStmt)
@@ -96,7 +96,7 @@ func StmtExec(L *lua.LState) int {
9696
return 1
9797
}
9898

99-
// StmtClose(): lua stmt_ud:close() returns err
99+
// StmtClose lua stmt_ud:close() returns err
100100
func StmtClose(L *lua.LState) int {
101101
ud := L.CheckUserData(1)
102102
s, ok := ud.Value.(*luaStmt)

filepath/api.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,28 @@ import (
77
lua "github.com/yuin/gopher-lua"
88
)
99

10-
// Basename(): lua filepath.basename(path) returns the last element of path
10+
// Basename lua filepath.basename(path) returns the last element of path
1111
func Basename(L *lua.LState) int {
1212
path := L.CheckString(1)
1313
L.Push(lua.LString(filepath.Base(path)))
1414
return 1
1515
}
1616

17-
// Dir(): lua filepath.dir(path) returns all but the last element of path, typically the path's directory
17+
// Dir lua filepath.dir(path) returns all but the last element of path, typically the path's directory
1818
func Dir(L *lua.LState) int {
1919
path := L.CheckString(1)
2020
L.Push(lua.LString(filepath.Dir(path)))
2121
return 1
2222
}
2323

24-
// Ext(): lua filepath.ext(path) returns the file name extension used by path.
24+
// Ext lua filepath.ext(path) returns the file name extension used by path.
2525
func Ext(L *lua.LState) int {
2626
path := L.CheckString(1)
2727
L.Push(lua.LString(filepath.Ext(path)))
2828
return 1
2929
}
3030

31-
// Join(): lua fileapth.join(path, ...) joins any number of path elements into a single path, adding a Separator if necessary.
31+
// Join lua fileapth.join(path, ...) joins any number of path elements into a single path, adding a Separator if necessary.
3232
func Join(L *lua.LState) int {
3333
path := L.CheckString(1)
3434
for i := 2; i <= L.GetTop(); i++ {
@@ -39,13 +39,13 @@ func Join(L *lua.LState) int {
3939
return 1
4040
}
4141

42-
// Separator(): lua filepath.separator() OS-specific path separator
42+
// Separator lua filepath.separator() OS-specific path separator
4343
func Separator(L *lua.LState) int {
4444
L.Push(lua.LString(filepath.Separator))
4545
return 1
4646
}
4747

48-
// ListSeparator(): lua filepath.list_separator() OS-specific path list separator
48+
// ListSeparator lua filepath.list_separator() OS-specific path list separator
4949
func ListSeparator(L *lua.LState) int {
5050
L.Push(lua.LString(filepath.ListSeparator))
5151
return 1

goos/api.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
lua "github.com/yuin/gopher-lua"
88
)
99

10-
// Stat(): lua goos.stat(filename) returns (table, err)
10+
// Stat lua goos.stat(filename) returns (table, err)
1111
func Stat(L *lua.LState) int {
1212
filename := L.CheckString(1)
1313
stat, err := os.Stat(filename)
@@ -25,7 +25,7 @@ func Stat(L *lua.LState) int {
2525
return 1
2626
}
2727

28-
// Hostname(): lua goos.hostname() returns (string, error)
28+
// Hostname lua goos.hostname() returns (string, error)
2929
func Hostname(L *lua.LState) int {
3030
hostname, err := os.Hostname()
3131
if err != nil {
@@ -37,7 +37,7 @@ func Hostname(L *lua.LState) int {
3737
return 1
3838
}
3939

40-
// Getpagesize(): lua goos.pagesize() return number
40+
// Getpagesize lua goos.pagesize() return number
4141
func Getpagesize(L *lua.LState) int {
4242
L.Push(lua.LNumber(os.Getpagesize()))
4343
return 1

http/client/request.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func HeaderSet(L *lua.LState) int {
6161
return 0
6262
}
6363

64-
// DoRequest(): lua http_client_ud:do_request()
64+
// DoRequest lua http_client_ud:do_request()
6565
// http_client_ud:do_request(http_request_ud) returns (response, error)
6666
// response: {
6767
// code=http_code (200, 201, ..., 500, ...),

http/util/util.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import (
66
lua "github.com/yuin/gopher-lua"
77
)
88

9-
// QueryEscape(): lua http.query_escape(string) returns escaped string
9+
// QueryEscape lua http.query_escape(string) returns escaped string
1010
func QueryEscape(L *lua.LState) int {
1111
query := L.CheckString(1)
1212
escapedUrl := url.QueryEscape(query)
1313
L.Push(lua.LString(escapedUrl))
1414
return 1
1515
}
1616

17-
// QueryUnescape(): lua http.query_unescape(string) returns unescaped (string, error)
17+
// QueryUnescape lua http.query_unescape(string) returns unescaped (string, error)
1818
func QueryUnescape(L *lua.LState) int {
1919
query := L.CheckString(1)
2020
url, err := url.QueryUnescape(query)
@@ -27,7 +27,7 @@ func QueryUnescape(L *lua.LState) int {
2727
return 1
2828
}
2929

30-
// ParseURL(): lua http.parse_url(string) returns (table, err)
30+
// ParseURL lua http.parse_url(string) returns (table, err)
3131
func ParseURL(L *lua.LState) int {
3232
u, err := url.Parse(L.CheckString(1))
3333
if err != nil {
@@ -69,7 +69,7 @@ func ParseURL(L *lua.LState) int {
6969
return 1
7070
}
7171

72-
// BuildURL(): lua http.parse_url(table) returns string
72+
// BuildURL lua http.parse_url(table) returns string
7373
func BuildURL(L *lua.LState) int {
7474
t := L.CheckTable(1)
7575
u := &url.URL{}

humanize/api.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import (
88
lua "github.com/yuin/gopher-lua"
99
)
1010

11-
// Time(): lua humanize.time(number) return string
11+
// Time lua humanize.time(number) return string
1212
func Time(L *lua.LState) int {
1313
then := time.Unix(L.CheckInt64(1), 0)
1414
L.Push(lua.LString(humanize.Time(then)))
1515
return 1
1616
}
1717

18-
// IBytes(): lua humanize.ibytes(number) return string
18+
// IBytes lua humanize.ibytes(number) return string
1919
func IBytes(L *lua.LState) int {
2020
bytes := L.CheckInt64(1)
2121
if bytes < 0 {
@@ -25,7 +25,7 @@ func IBytes(L *lua.LState) int {
2525
return 1
2626
}
2727

28-
// ParseBytes(): lua humanize.parse_bytes(string) returns (number, err)
28+
// ParseBytes lua humanize.parse_bytes(string) returns (number, err)
2929
func ParseBytes(L *lua.LState) int {
3030
data := L.CheckString(1)
3131
size, err := humanize.ParseBytes(data)
@@ -38,7 +38,7 @@ func ParseBytes(L *lua.LState) int {
3838
return 1
3939
}
4040

41-
// SI(): lua humanize.si(number, string) return string
41+
// SI lua humanize.si(number, string) return string
4242
func SI(L *lua.LState) int {
4343
value := L.CheckNumber(1)
4444
input := float64(value)

0 commit comments

Comments
 (0)