Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3-blocksutil
Commits
3c65b0d7
Commit
3c65b0d7
authored
May 05, 2016
by
Kevin Atkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make blocks.Block an interface.
License: MIT Signed-off-by:
Kevin Atkinson
<
k@kevina.org
>
parent
5ec59c29
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
block_generator.go
block_generator.go
+3
-3
No files found.
block_generator.go
View file @
3c65b0d7
...
@@ -10,13 +10,13 @@ type BlockGenerator struct {
...
@@ -10,13 +10,13 @@ type BlockGenerator struct {
seq
int
seq
int
}
}
func
(
bg
*
BlockGenerator
)
Next
()
*
blocks
.
Block
{
func
(
bg
*
BlockGenerator
)
Next
()
blocks
.
Block
{
bg
.
seq
++
bg
.
seq
++
return
blocks
.
NewBlock
([]
byte
(
string
(
bg
.
seq
)))
return
blocks
.
NewBlock
([]
byte
(
string
(
bg
.
seq
)))
}
}
func
(
bg
*
BlockGenerator
)
Blocks
(
n
int
)
[]
*
blocks
.
Block
{
func
(
bg
*
BlockGenerator
)
Blocks
(
n
int
)
[]
blocks
.
Block
{
blocks
:=
make
([]
*
blocks
.
Block
,
0
)
blocks
:=
make
([]
blocks
.
Block
,
0
)
for
i
:=
0
;
i
<
n
;
i
++
{
for
i
:=
0
;
i
<
n
;
i
++
{
b
:=
bg
.
Next
()
b
:=
bg
.
Next
()
blocks
=
append
(
blocks
,
b
)
blocks
=
append
(
blocks
,
b
)
...
...
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