Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
a0b51aa6
Commit
a0b51aa6
authored
Mar 14, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c38ab95d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
t/neo/storage/fs1/cmd/fstail/fstail.go
t/neo/storage/fs1/cmd/fstail/fstail.go
+11
-8
No files found.
t/neo/storage/fs1/cmd/fstail/fstail.go
View file @
a0b51aa6
...
...
@@ -36,7 +36,7 @@ func fsDump(w io.Writer, path string, ntxn int) (err error) {
// path & fsdump on error context
defer
func
()
{
if
err
!=
nil
{
err
=
fmt
.
Errorf
(
"%s: fsdump: %v"
,
err
)
err
=
fmt
.
Errorf
(
"%s: fsdump: %v"
,
path
,
err
)
}
}()
...
...
@@ -116,8 +116,12 @@ func fsDump(w io.Writer, path string, ntxn int) (err error) {
return
err
}
func
usage
()
{
fmt
.
Fprintf
(
os
.
Stderr
,
func
main
()
{
ntxn
:=
10
usage
:=
func
()
{
fmt
.
Fprintf
(
os
.
Stderr
,
`fstail [options] <storage>
Dump transactions from a FileStorage in reverse order
...
...
@@ -127,11 +131,10 @@ Dump transactions from a FileStorage in reverse order
-h --help this help text.
-n <N> output the last <N> transactions (default %d).
`
)
}
`
,
ntxn
)
}
func
main
()
{
ntxn
:=
10
flag
.
Usage
=
usage
flag
.
IntVar
(
&
ntxn
,
"n"
,
ntxn
,
"output the last <N> transactions"
)
flag
.
Parse
()
...
...
@@ -142,7 +145,7 @@ func main() {
}
storPath
:=
argv
[
0
]
err
:=
fsDump
(
os
.
Stdout
,
storPath
,
n
)
err
:=
fsDump
(
os
.
Stdout
,
storPath
,
n
txn
)
if
err
!=
nil
{
log
.
Fatal
(
err
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment