Skip to content

Commit 78f9a17

Browse files
committed
Fix package name and docs
Signed-off-by: Dusan Borovcanin <[email protected]>
1 parent 26a82cc commit 78f9a17

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

bit/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# stats [![GoDoc](https://godoc.org/github.com/vadv/gopher-lua-libs/bit?bit.svg)](https://godoc.org/github.com/vadv/gopher-lua-libs/stats)
1+
# stats [![GoDoc](https://godoc.org/github.com/vadv/gopher-lua-libs/bit?bit.svg)](https://godoc.org/github.com/vadv/gopher-lua-libs/bit)
22

33
## Usage
44

55
```lua
6-
local stats = require("bit")
6+
local bit = require("bit")
77

88
local result, _ = bit.band(1, 0)
99
print(result)
1010
-- Output: 0
1111

12-
local result, _ = stats.lshift(10, 5)
12+
local result, _ = bit.lshift(10, 5)
1313
print(result)
1414
-- Output: 320
1515
```

bit/api.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Package strings implements golang package montanaflynn/stats functionality for lua.
2-
package stats
1+
// Package bit implements Go bitwise operations functionality for Lua.
2+
package bit
33

44
import (
55
"fmt"
@@ -19,7 +19,7 @@ const (
1919
rs
2020
)
2121

22-
// ShiftLeft
22+
// Bitwise returns a Lua function used for bitwise operations.
2323
func Bitwise(kind op) lua.LGFunction {
2424
return func(l *lua.LState) int {
2525
if kind > rs {
@@ -49,6 +49,7 @@ func Bitwise(kind op) lua.LGFunction {
4949
}
5050
}
5151

52+
// Not implements bitwise not.
5253
func Not(l *lua.LState) int {
5354
val, err := intToU32(l.CheckInt(1))
5455
if err != nil {
@@ -59,12 +60,12 @@ func Not(l *lua.LState) int {
5960
return 1
6061
}
6162

62-
func prepareParams(l *lua.LState) (val, pos uint32, err error) {
63-
val, err = intToU32(l.CheckInt(1))
63+
func prepareParams(l *lua.LState) (val1, val2 uint32, err error) {
64+
val1, err = intToU32(l.CheckInt(1))
6465
if err != nil {
6566
return 0, 0, err
6667
}
67-
pos, err = intToU32(l.CheckInt(2))
68+
val2, err = intToU32(l.CheckInt(2))
6869
if err != nil {
6970
return 0, 0, err
7071
}

bit/api_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
package stats
1+
package bit
22

33
import (
4+
"testing"
5+
46
"github.com/stretchr/testify/assert"
57
"github.com/vadv/gopher-lua-libs/tests"
6-
"testing"
78
)
89

910
func TestApi(t *testing.T) {

bit/loader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package stats
1+
package bit
22

33
import lua "github.com/yuin/gopher-lua"
44

0 commit comments

Comments
 (0)