mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-14 15:07:33 +08:00
code refactor
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package core
|
||||
|
||||
import "context"
|
||||
|
||||
const nullContextId = "00000000-0000-0000-0000-00000000"
|
||||
|
||||
// NullContext represents the null context
|
||||
type NullContext struct {
|
||||
context.Context
|
||||
}
|
||||
|
||||
// GetContextId returns the current context id
|
||||
func (c *NullContext) GetContextId() string {
|
||||
return nullContextId
|
||||
}
|
||||
|
||||
// NewCronJobContext returns a new null context
|
||||
func NewNullContext() *NullContext {
|
||||
return &NullContext{
|
||||
Context: context.Background(),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user