From 3228f36fec50930483801b27b92658592fab5e87 Mon Sep 17 00:00:00 2001 From: Yu Lun Hsu <48343225+alan890104@users.noreply.github.com> Date: Tue, 3 May 2022 21:38:26 +0800 Subject: [PATCH] Update getting-started.md (#2140) * Update getting-started.md function rand.Int requires two parameters and returns two value in golang version 1.18.1. * Highlight the package used so people don't pick crypto/rand * Revert to original * Remove extra space Co-authored-by: Steve Coffman --- docs/content/getting-started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/getting-started.md b/docs/content/getting-started.md index d09b5f36a52..300463bfb5c 100644 --- a/docs/content/getting-started.md +++ b/docs/content/getting-started.md @@ -135,7 +135,7 @@ type Resolver struct{ } ``` -Returning to `graph/schema.resolvers.go`, let's implement the bodies of those automatically generated resolver functions. For `CreateTodo`, we'll use `math.rand` to simply return a todo with a randomly generated ID and store that in the in-memory todos list --- in a real app, you're likely to use a database or some other backend service. +Returning to `graph/schema.resolvers.go`, let's implement the bodies of those automatically generated resolver functions. For `CreateTodo`, we'll use the [`math.rand` package](https://pkg.go.dev/math/rand#Rand.Int) to simply return a todo with a randomly generated ID and store that in the in-memory todos list --- in a real app, you're likely to use a database or some other backend service. ```go func (r *mutationResolver) CreateTodo(ctx context.Context, input model.NewTodo) (*model.Todo, error) {