Skip to content

Commit 3d2724b

Browse files
author
Montana Flynn
committed
Pass jshint
1 parent 1fc614d commit 3d2724b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/targets/go/native.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ module.exports = function (options) {
2525

2626
var bodyPresent = this.source.postData && this.source.postData.text;
2727

28-
var errorPlaceholder = opts.checkErrors ? "err" : "_"
28+
var errorPlaceholder = opts.checkErrors ? 'err' : '_';
2929

3030
var errorCheck = function() {
3131
if (opts.checkErrors) {
3232
code.push('\tif err != nil {');
3333
code.push('\t\tpanic(err)');
3434
code.push('\t}');
3535
}
36-
}
36+
};
3737

3838
// Create boilerplate
3939
code.push('package main\n');
@@ -59,6 +59,7 @@ module.exports = function (options) {
5959
}
6060

6161
code.push('\treq, ' + errorPlaceholder + ' := http.NewRequest("' + req.method + '", url, ' + req.body + ')');
62+
errorCheck();
6263

6364
// Add headers
6465
var headersPresent = this.source.headers && this.source.headers.length;
@@ -82,11 +83,12 @@ module.exports = function (options) {
8283

8384
// Make request
8485
code.push('\tres, ' + errorPlaceholder + ' := client.Do(req)');
86+
errorCheck();
8587

8688
// Get Body
8789
if (opts.printBody) code.push('\tdefer res.Body.Close()');
8890
if (opts.printBody) code.push('\tbody, ' + errorPlaceholder + ' := ioutil.ReadAll(res.Body)');
89-
errorCheck()
91+
errorCheck();
9092

9193
// Print it
9294
code.push('\tfmt.Println(res)');

0 commit comments

Comments
 (0)