hongbo-miao/hongbomiao.com

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

Summary

Maintainability
A
0 mins
Test Coverage
package utils

import (
    "time"
)

type CurrentTime struct {
    Now string `json:"now"`
}

func GetCurrentTime() (*CurrentTime, error) {
    now := time.Now()
    return &CurrentTime{
        Now: now.String(),
    }, nil
}