We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e553ca1 commit 81fbf54Copy full SHA for 81fbf54
1 file changed
src/targets/go/native.js
@@ -3,6 +3,7 @@
3
var util = require('util');
4
5
module.exports = function (source, options) {
6
+
7
// Let's Go!
8
var code = [];
9
@@ -28,6 +29,10 @@ module.exports = function (source, options) {
28
29
code.push('import (');
30
code.push('\t"fmt"');
31
32
+ if (opts.timeout > 0) {
33
+ code.push('\t"time"');
34
+ }
35
36
if (source.postData.text) {
37
code.push('\t"strings"');
38
}
@@ -45,7 +50,7 @@ module.exports = function (source, options) {
45
50
// Create client
46
51
if (opts.timeout > 0) {
47
52
code.push('\tclient := http.Client{');
48
- code.push('\t\tTimeout: time.Duration(' + opts.timeout + ' * time.Second),');
53
+ code.push(util.format('\t\tTimeout: time.Duration(%s * time.Second),', opts.timeout));
49
54
code.push('\t}');
55
} else {
56
code.push('\tclient := &http.Client{}');
0 commit comments