Skip to content

Instantly share code, notes, and snippets.

@azhuox

azhuox/block6.go Secret

Created December 2, 2020 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azhuox/d1eaf1074c12e4cda400992e626e0bb3 to your computer and use it in GitHub Desktop.
Save azhuox/d1eaf1074c12e4cda400992e626e0bb3 to your computer and use it in GitHub Desktop.
package user
import (
"context"
"time"
)
// CreateUserRequest - request body for creating a user.
type CreateUserRequest struct {
Name string
Email string
createdAt time.Time
}
// CreateUser - creates a user in the database.
func (r *UserRepo) CreateUser(ctx context.Context, req CreateUserRequest) error {
req.createdAt = time.Now().UTC()
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment