Skip to content

Commit 90e366b

Browse files
authored
Merge pull request #15 from wojas/github-actions-ci
CI: switch to Github Actions
2 parents 81e585c + faf966b commit 90e366b

File tree

8 files changed

+59
-35
lines changed

8 files changed

+59
-35
lines changed

.github/workflows/go.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will build a golang project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
3+
4+
name: Go Tests
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
pull_request:
11+
branches:
12+
- master
13+
14+
jobs:
15+
16+
build:
17+
runs-on: ubuntu-22.04
18+
strategy:
19+
matrix:
20+
go:
21+
- '1.19'
22+
- '1.20'
23+
- '1.21'
24+
- '1.x'
25+
26+
name: Go ${{ matrix.go }} tests
27+
steps:
28+
- uses: actions/checkout@v3
29+
- name: Set up Go
30+
uses: actions/setup-go@v3
31+
with:
32+
go-version: ${{ matrix.go }}
33+
- name: Install golint
34+
run: go install golang.org/x/lint/golint@latest
35+
- name: Install goimports
36+
run: go install golang.org/x/tools/cmd/goimports@latest
37+
- name: Build and test
38+
run: make all
39+

.travis.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

exp/lmdbsync/lmdbsync.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Bypassing an Env's methods to access the underlying lmdb.Env is not safe. The
88
severity of such usage depends such behavior should be strictly avoided as it
99
may produce undefined behavior from the LMDB C library.
1010
11-
Resizing the environment
11+
# Resizing the environment
1212
1313
The Env type synchronizes all calls to Env.SetMapSize so that it may, with some
1414
caveats, be safely called in the presence of concurrent transactions after an
@@ -65,7 +65,7 @@ not OS X).
6565
6666
See mdb_env_set_mapsize.
6767
68-
MapFull
68+
# MapFull
6969
7070
The MapFullHandler function configures an Env to automatically call increase
7171
the map size with Env.SetMapSize and retry transactions when a lmdb.MapFull
@@ -77,7 +77,7 @@ and do not cause unwanted additive change to the program state.
7777
7878
See mdb_txn_commit and MDB_MAP_FULL.
7979
80-
MapResized
80+
# MapResized
8181
8282
When multiple processes access and resize an environment it is not uncommon to
8383
encounter a MapResized error which prevents the TxnOp from being executed and
@@ -90,7 +90,7 @@ TxnOp.
9090
9191
See mdb_txn_begin and MDB_MAP_RESIZED.
9292
93-
NoLock
93+
# NoLock
9494
9595
When the lmdb.NoLock flag is set on an environment Env handles all transaction
9696
synchronization using Go structures and is an experimental feature. It is

lmdb/error.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ const (
6363
// Most often helper functions such as IsNotFound may be used instead of
6464
// dealing with Errno values directly.
6565
//
66-
// lmdb.IsNotFound(err)
67-
// lmdb.IsErrno(err, lmdb.TxnFull)
68-
// lmdb.IsErrnoSys(err, syscall.EINVAL)
69-
// lmdb.IsErrnoFn(err, os.IsPermission)
66+
// lmdb.IsNotFound(err)
67+
// lmdb.IsErrno(err, lmdb.TxnFull)
68+
// lmdb.IsErrnoSys(err, syscall.EINVAL)
69+
// lmdb.IsErrnoFn(err, os.IsPermission)
7070
type Errno C.int
7171

7272
// minimum and maximum values produced for the Errno type. syscall.Errnos of

lmdb/error_unix.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !windows
12
// +build !windows
23

34
package lmdb

lmdb/lmdb.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ reference.
88
http://www.lmdb.tech/doc/starting.html
99
http://www.lmdb.tech/doc/modules.html
1010
11-
12-
Environment
11+
# Environment
1312
1413
An LMDB environment holds named databases (key-value stores). An environment
1514
is represented as one file on the filesystem (though often a corresponding lock
@@ -25,8 +24,7 @@ Note that the package lmdb forces all Env objects to be opened with the NoTLS
2524
(in the author's opinion). However, even for environments opened with this
2625
flag there are caveats regarding how transactions are used (see Caveats below).
2726
28-
29-
Databases
27+
# Databases
3028
3129
A database in an LMDB environment is an ordered key-value store that holds
3230
arbitrary binary data. Typically the keys are unique but duplicate keys may be
@@ -43,8 +41,7 @@ closed but it is not required. Typically, applications acquire handles for all
4341
their databases immediately after opening an environment and retain them for
4442
the lifetime of the process.
4543
46-
47-
Transactions
44+
# Transactions
4845
4946
View (readonly) transactions in LMDB operate on a snapshot of the database at
5047
the time the transaction began. The number of simultaneously active view
@@ -108,8 +105,7 @@ uses a finalizer to abort unreachable Txn objects. But of course, applications
108105
must still be careful not to leak unterminated Txn objects in a way such that
109106
they fail get garbage collected.
110107
111-
112-
Caveats
108+
# Caveats
113109
114110
Write transactions (those created without the Readonly flag) must be created in
115111
a goroutine that has been locked to its thread by calling the function

lmdb/msgfunc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type msgfunc func(string) error
3737
// not contain pointers in their struct fields. See the following language
3838
// proposal which discusses the restrictions on passing pointers to C.
3939
//
40-
// https://github.com/golang/proposal/blob/master/design/12416-cgo-pointers.md
40+
// https://github.com/golang/proposal/blob/master/design/12416-cgo-pointers.md
4141
type msgctx uintptr
4242
type _msgctx struct {
4343
fn msgfunc

lmdb/val.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import (
1919
// source file malloc.go and the compiler typecheck.go for more information
2020
// about memory limits and array bound limits.
2121
//
22-
// https://github.com/golang/go/blob/a03bdc3e6bea34abd5077205371e6fb9ef354481/src/runtime/malloc.go#L151-L164
23-
// https://github.com/golang/go/blob/36a80c5941ec36d9c44d6f3c068d13201e023b5f/src/cmd/compile/internal/gc/typecheck.go#L383
22+
// https://github.com/golang/go/blob/a03bdc3e6bea34abd5077205371e6fb9ef354481/src/runtime/malloc.go#L151-L164
23+
// https://github.com/golang/go/blob/36a80c5941ec36d9c44d6f3c068d13201e023b5f/src/cmd/compile/internal/gc/typecheck.go#L383
2424
//
2525
// On 64-bit systems, luckily, the value 2^32-1 coincides with the maximum data
2626
// size for LMDB (MAXDATASIZE).
@@ -42,9 +42,9 @@ type Multi struct {
4242
// WrapMulti converts a page of contiguous values with stride size into a
4343
// Multi. WrapMulti panics if len(page) is not a multiple of stride.
4444
//
45-
// _, val, _ := cursor.Get(nil, nil, lmdb.FirstDup)
46-
// _, page, _ := cursor.Get(nil, nil, lmdb.GetMultiple)
47-
// multi := lmdb.WrapMulti(page, len(val))
45+
// _, val, _ := cursor.Get(nil, nil, lmdb.FirstDup)
46+
// _, page, _ := cursor.Get(nil, nil, lmdb.GetMultiple)
47+
// multi := lmdb.WrapMulti(page, len(val))
4848
//
4949
// See mdb_cursor_get and MDB_GET_MULTIPLE.
5050
func WrapMulti(page []byte, stride int) *Multi {
@@ -83,8 +83,7 @@ func (m *Multi) Stride() int {
8383

8484
// Size returns the total size of the Multi data and is equal to
8585
//
86-
// m.Len()*m.Stride()
87-
//
86+
// m.Len()*m.Stride()
8887
func (m *Multi) Size() int {
8988
return len(m.page)
9089
}

0 commit comments

Comments
 (0)