hongbo-miao/hongbomiao.com

View on GitHub
api-go/internal/graphql_server/utils/seed.go

Summary

Maintainability
A
0 mins
Test Coverage
package utils

type Seed struct {
    SeedNumber int `json:"seedNumber"`
}

var seedNumber = 42

func GetSeed() (*Seed, error) {
    return &Seed{
        SeedNumber: seedNumber,
    }, nil
}

func SetSeed(n int) (*Seed, error) {
    seedNumber = n
    return &Seed{
        SeedNumber: seedNumber,
    }, nil
}