Skip to content

Commit

Permalink
Merge branch 'cache-perf' into cache-multi
Browse files Browse the repository at this point in the history
  • Loading branch information
dsame committed Aug 8, 2023
2 parents 0e99268 + aefc3f3 commit df169d9
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
4 changes: 3 additions & 1 deletion greetings/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module example.com/greetings

go 1.20
go 1.12

require github.com/google/uuid v1.3.0 // indirect
2 changes: 2 additions & 0 deletions greetings/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
8 changes: 6 additions & 2 deletions greetings/greetings.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package greetings

import "fmt"
import (
"fmt"
"github.com/google/uuid"
)

// Hello returns a greeting for the named person.
func Hello(name string) string {
// Return a greeting that embeds the name in a message.
message := fmt.Sprintf("Hi, %v. Welcome!", name)
var id = uuid.NewString()
message := fmt.Sprintf("Hi, %v. Welcome! - %v", name, id)
return message
}
1 change: 1 addition & 0 deletions hello/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hello
2 changes: 2 additions & 0 deletions hello/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ go 1.20
replace example.com/greetings => ../greetings

require example.com/greetings v0.0.0-00010101000000-000000000000

require github.com/google/uuid v1.3.0 // indirect
2 changes: 2 additions & 0 deletions hello/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
6 changes: 4 additions & 2 deletions hello/hello.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ package main

import (
"fmt"
"math/rand"

"example.com/greetings"
)

func main() {
// Get a greeting message and print it.
var r = rand.Intn(10)
message := greetings.Hello("Gladys")
fmt.Println(message)
message2 := fmt.Sprintf("%v: %v", message, r)
fmt.Println(message2)
}

0 comments on commit df169d9

Please sign in to comment.