Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
d0854c69
Commit
d0854c69
authored
Nov 30, 2015
by
Brendan Melville
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Service responses will now be presented in YAML.
parent
7480f215
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
dm.go
dm/dm.go
+9
-3
No files found.
dm/dm.go
View file @
d0854c69
...
@@ -176,11 +176,17 @@ func callService(path, method, action string, reader io.ReadCloser) {
...
@@ -176,11 +176,17 @@ func callService(path, method, action string, reader io.ReadCloser) {
u
:=
fmt
.
Sprintf
(
"%s/%s"
,
*
service
,
path
)
u
:=
fmt
.
Sprintf
(
"%s/%s"
,
*
service
,
path
)
resp
:=
callHttp
(
u
,
method
,
action
,
reader
)
resp
:=
callHttp
(
u
,
method
,
action
,
reader
)
var
prettyJSON
bytes
.
Buffer
var
j
interface
{}
if
err
:=
json
.
Indent
(
&
prettyJSON
,
[]
byte
(
resp
),
""
,
" "
);
err
!=
nil
{
if
err
:=
json
.
Unmarshal
([]
byte
(
resp
),
&
j
);
err
!=
nil
{
log
.
Fatalf
(
"Failed to parse JSON response from service: %s"
,
resp
)
log
.
Fatalf
(
"Failed to parse JSON response from service: %s"
,
resp
)
}
}
fmt
.
Println
(
prettyJSON
.
String
())
y
,
err
:=
yaml
.
Marshal
(
j
)
if
err
!=
nil
{
log
.
Fatalf
(
"Failed to serialize JSON response from service: %s"
,
resp
)
}
fmt
.
Println
(
string
(
y
))
}
}
func
callHttp
(
path
,
method
,
action
string
,
reader
io
.
ReadCloser
)
string
{
func
callHttp
(
path
,
method
,
action
string
,
reader
io
.
ReadCloser
)
string
{
...
...
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