Skip to content

Commit

Permalink
Init random seed
Browse files Browse the repository at this point in the history
  • Loading branch information
jypelle committed Dec 5, 2021
1 parent 1ef06e3 commit ed0dd9a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cmd/mifasolcli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"github.com/jypelle/mifasol/internal/cli"
"github.com/jypelle/mifasol/internal/version"
"math/rand"
"os"
"path/filepath"
"time"
Expand All @@ -15,6 +16,8 @@ import (
const configSuffix = "mifasolcli"

func main() {
// Set random seed
rand.Seed(time.Now().UnixNano())

// Logger
logrus.SetFormatter(&logrus.TextFormatter{ForceColors: true})
Expand Down
4 changes: 4 additions & 0 deletions cmd/mifasolcliwa/main_wasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ package main

import (
"github.com/jypelle/mifasol/internal/cliwa"
"math/rand"
"time"
)

func main() {
// Set random seed
rand.Seed(time.Now().UnixNano())

// Create mifasol webassembly client
app := cliwa.NewApp(true)
Expand Down
3 changes: 3 additions & 0 deletions cmd/mifasolsrv/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"github.com/jypelle/mifasol/internal/srv"
"github.com/jypelle/mifasol/internal/version"
"math/rand"
"os"
"os/signal"
"path/filepath"
Expand All @@ -18,6 +19,8 @@ import (
const configSuffix = "mifasolsrv"

func main() {
// Set random seed
rand.Seed(time.Now().UnixNano())

// Logger
logrus.SetFormatter(&logrus.TextFormatter{ForceColors: true})
Expand Down
2 changes: 1 addition & 1 deletion internal/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ var (
AppVersion = restApiV1.Version{
MajorNumber: 0,
MinorNumber: 4,
PatchNumber: 0,
PatchNumber: 1,
}
)

0 comments on commit ed0dd9a

Please sign in to comment.