package common import ( "context" "errors" "runtime" ) type ReactiveHandlerOnOS struct { HandleFunc map[string]func(ctx context.Context) (context.Context, error) } func (h *ReactiveHandlerOnOS) Handle(ctx context.Context) (context.Context, error) { handle, ok := h.HandleFunc[runtime.GOOS] if !ok { return nil, errors.New("unsupported error") } return handle(ctx) }