Skip to content

Commit 0ab40ff

Browse files
authored
Merge pull request #1 from msgodf/request-id
Bump fn_go to 0.2.12.
2 parents ec6c02c + 98745a5 commit 0ab40ff

File tree

4 files changed

+27
-6
lines changed

4 files changed

+27
-6
lines changed

Gopkg.lock

+12-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ignored = ["github.com/Azure/go-ansiterm*"]
3131

3232
[[constraint]]
3333
name = "github.com/fnproject/fn_go"
34-
version = "0.2.11"
34+
version = "0.2.12"
3535

3636
[[constraint]]
3737
name = "github.com/giantswarm/semver-bump"

main.go

+13-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ package main
22

33
import (
44
"bytes"
5+
"crypto/rand"
6+
"encoding/base32"
57
"fmt"
68
"io"
9+
"log"
710
"os"
811
"sort"
912
"strings"
@@ -18,6 +21,16 @@ import (
1821
"github.com/urfave/cli"
1922
)
2023

24+
func getRequestID() string {
25+
byteArr := make([]byte, 16)
26+
_, err := rand.Read(byteArr)
27+
if err != nil {
28+
log.Fatalf("failed to generate random number for requestID")
29+
}
30+
31+
return base32.StdEncoding.WithPadding(base32.NoPadding).EncodeToString(byteArr)
32+
}
33+
2134
func newFn() *cli.App {
2235
app := cli.NewApp()
2336
app.Name = "fn"
@@ -30,7 +43,6 @@ func newFn() *cli.App {
3043
if err != nil {
3144
return err
3245
}
33-
3446
viper.Set(common.RequestID, common.GetRequestID())
3547
commandArgOverrides(c)
3648
return nil

objects/app/apps.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
"github.com/fnproject/cli/client"
1414
"github.com/fnproject/cli/common"
15-
fnclient "github.com/fnproject/fn_go/client"
15+
fnclient "github.com/fnproject/fn_go/client"
1616
apiapps "github.com/fnproject/fn_go/client/apps"
1717
"github.com/fnproject/fn_go/models"
1818
"github.com/fnproject/fn_go/provider"

0 commit comments

Comments
 (0)