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
Commits
ff305581
Commit
ff305581
authored
Feb 23, 2015
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make it easier to create custom dag objects via the CLI
parent
5ea2afc4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
core/commands/object.go
core/commands/object.go
+3
-3
No files found.
core/commands/object.go
View file @
ff305581
...
@@ -24,7 +24,7 @@ const inputLimit = 512 * 1024
...
@@ -24,7 +24,7 @@ const inputLimit = 512 * 1024
type
Node
struct
{
type
Node
struct
{
Links
[]
Link
Links
[]
Link
Data
[]
byte
Data
string
}
}
var
ObjectCmd
=
&
cmds
.
Command
{
var
ObjectCmd
=
&
cmds
.
Command
{
...
@@ -167,7 +167,7 @@ This command outputs data in the following encodings:
...
@@ -167,7 +167,7 @@ This command outputs data in the following encodings:
node
:=
&
Node
{
node
:=
&
Node
{
Links
:
make
([]
Link
,
len
(
object
.
Links
)),
Links
:
make
([]
Link
,
len
(
object
.
Links
)),
Data
:
object
.
Data
,
Data
:
string
(
object
.
Data
)
,
}
}
for
i
,
link
:=
range
object
.
Links
{
for
i
,
link
:=
range
object
.
Links
{
...
@@ -448,7 +448,7 @@ func getOutput(dagnode *dag.Node) (*Object, error) {
...
@@ -448,7 +448,7 @@ func getOutput(dagnode *dag.Node) (*Object, error) {
// converts the Node object into a real dag.Node
// converts the Node object into a real dag.Node
func
deserializeNode
(
node
*
Node
)
(
*
dag
.
Node
,
error
)
{
func
deserializeNode
(
node
*
Node
)
(
*
dag
.
Node
,
error
)
{
dagnode
:=
new
(
dag
.
Node
)
dagnode
:=
new
(
dag
.
Node
)
dagnode
.
Data
=
node
.
Data
dagnode
.
Data
=
[]
byte
(
node
.
Data
)
dagnode
.
Links
=
make
([]
*
dag
.
Link
,
len
(
node
.
Links
))
dagnode
.
Links
=
make
([]
*
dag
.
Link
,
len
(
node
.
Links
))
for
i
,
link
:=
range
node
.
Links
{
for
i
,
link
:=
range
node
.
Links
{
hash
,
err
:=
mh
.
FromB58String
(
link
.
Hash
)
hash
,
err
:=
mh
.
FromB58String
(
link
.
Hash
)
...
...
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