diff --git a/.compat/api/api.go b/.compat/api/api.go new file mode 100644 index 0000000..617f71d --- /dev/null +++ b/.compat/api/api.go @@ -0,0 +1,169 @@ +package api + +import ( + "context" + "net/http" + + "github.com/gin-gonic/gin" +) + +type RouteDescription struct { + Method string `json:"method,omitempty"` + Path string `json:"path,omitempty"` + Summary string `json:"summary,omitempty"` + Description string `json:"description,omitempty"` + Tags []string `json:"tags,omitempty"` + RequestBody map[string]any `json:"requestBody,omitempty"` + Responses map[string]any `json:"responses,omitempty"` +} + +type RouteGroup interface { + Name() string + BasePath() string + RegisterRoutes(*gin.RouterGroup) +} + +type DescribableGroup interface { + RouteGroup + Describe() []RouteDescription +} + +type response struct { + Success bool `json:"success"` + Data any `json:"data,omitempty"` + Error string `json:"error,omitempty"` + Code string `json:"code,omitempty"` + Details any `json:"details,omitempty"` +} + +func OK(data any) any { + return response{Success: true, Data: data} +} + +func Fail(code, message string) any { + return response{Success: false, Code: code, Error: message} +} + +func FailWithDetails(code, message string, details any) any { + return response{Success: false, Code: code, Error: message, Details: details} +} + +type Option func(*Engine) + +func WithAddr(addr string) Option { + return func(e *Engine) { e.addr = addr } +} + +func WithWSPath(path string) Option { + return func(e *Engine) { e.wsPath = path } +} + +func WithWSHandler(handler http.HandlerFunc) Option { + return func(e *Engine) { e.wsHandler = handler } +} + +type Engine struct { + router *gin.Engine + addr string + wsPath string + wsHandler http.HandlerFunc +} + +func New(opts ...Option) (*Engine, error) { + engine := &Engine{router: gin.New()} + for _, opt := range opts { + opt(engine) + } + if engine.wsPath != "" && engine.wsHandler != nil { + engine.router.GET(engine.wsPath, gin.WrapF(engine.wsHandler)) + } + return engine, nil +} + +func (e *Engine) Register(group RouteGroup) { + if e == nil || group == nil { + return + } + group.RegisterRoutes(e.router.Group(group.BasePath())) +} + +func (e *Engine) Serve(ctx context.Context) error { + if e == nil { + return nil + } + server := &http.Server{Addr: e.addr, Handler: e.router} + errCh := make(chan error, 1) + go func() { errCh <- server.ListenAndServe() }() + select { + case <-ctx.Done(): + if err := server.Shutdown(context.Background()); err != nil { + return err + } + return ctx.Err() + case err := <-errCh: + return err + } +} + +func (e *Engine) Handler() http.Handler { + if e == nil { + return http.NewServeMux() + } + return e.router +} + +type ToolDescriptor struct { + Name string `json:"name"` + Description string `json:"description,omitempty"` + Group string `json:"group,omitempty"` +} + +type ToolBridge struct { + basePath string + tools []toolRoute +} + +type toolRoute struct { + descriptor ToolDescriptor + handler gin.HandlerFunc +} + +func NewToolBridge(basePath string) *ToolBridge { + return &ToolBridge{basePath: basePath} +} + +func (b *ToolBridge) Name() string { return "mcp" } + +func (b *ToolBridge) BasePath() string { + if b == nil { + return "" + } + return b.basePath +} + +func (b *ToolBridge) Add(descriptor ToolDescriptor, handler gin.HandlerFunc) { + if b == nil { + return + } + b.tools = append(b.tools, toolRoute{descriptor: descriptor, handler: handler}) +} + +func (b *ToolBridge) RegisterRoutes(group *gin.RouterGroup) { + if b == nil { + return + } + for _, tool := range b.tools { + group.POST("/"+tool.descriptor.Name, tool.handler) + } +} + +func (b *ToolBridge) Tools() []ToolDescriptor { + if b == nil { + return nil + } + out := make([]ToolDescriptor, 0, len(b.tools)) + for _, tool := range b.tools { + out = append(out, tool.descriptor) + } + return out +} diff --git a/.compat/api/go.mod b/.compat/api/go.mod new file mode 100644 index 0000000..741ca00 --- /dev/null +++ b/.compat/api/go.mod @@ -0,0 +1,5 @@ +module dappco.re/go/api + +go 1.26.0 + +require github.com/gin-gonic/gin v1.12.0 diff --git a/.compat/api/pkg/provider/provider.go b/.compat/api/pkg/provider/provider.go new file mode 100644 index 0000000..4b3f8e6 --- /dev/null +++ b/.compat/api/pkg/provider/provider.go @@ -0,0 +1,77 @@ +package provider + +import "github.com/gin-gonic/gin" + +type Provider interface { + Name() string + BasePath() string + RegisterRoutes(*gin.RouterGroup) +} + +type Streamable interface { + Provider + Channels() []string +} + +type Describable interface { + Provider +} + +type Renderable interface { + Provider + Element() ElementSpec +} + +type ElementSpec struct { + Tag string `json:"tag"` + Source string `json:"source"` +} + +type Registry struct { + providers map[string]Provider + order []string +} + +func NewRegistry() *Registry { + return &Registry{providers: make(map[string]Provider)} +} + +func (r *Registry) Add(provider Provider) { + if r == nil || provider == nil { + return + } + name := provider.Name() + if _, exists := r.providers[name]; !exists { + r.order = append(r.order, name) + } + r.providers[name] = provider +} + +func (r *Registry) Get(name string) Provider { + if r == nil { + return nil + } + return r.providers[name] +} + +func (r *Registry) Info() []map[string]any { + if r == nil { + return nil + } + info := make([]map[string]any, 0, len(r.order)) + for _, name := range r.order { + p := r.providers[name] + entry := map[string]any{ + "name": p.Name(), + "base_path": p.BasePath(), + } + if streamable, ok := p.(Streamable); ok { + entry["channels"] = streamable.Channels() + } + if renderable, ok := p.(Renderable); ok { + entry["element"] = renderable.Element() + } + info = append(info, entry) + } + return info +} diff --git a/.compat/cli/go.mod b/.compat/cli/go.mod new file mode 100644 index 0000000..9961ba5 --- /dev/null +++ b/.compat/cli/go.mod @@ -0,0 +1,3 @@ +module dappco.re/go/cli + +go 1.26.0 diff --git a/.compat/cli/pkg/cli/cli.go b/.compat/cli/pkg/cli/cli.go new file mode 100644 index 0000000..fe8caaa --- /dev/null +++ b/.compat/cli/pkg/cli/cli.go @@ -0,0 +1,109 @@ +package cli + +import ( + "context" + "errors" + "fmt" + "io" + "os" +) + +type Style struct{} + +func (Style) Render(text string) string { return text } + +var ( + TitleStyle Style + ValueStyle Style + SuccessStyle Style + ErrorStyle Style + DimStyle Style + RepoStyle Style +) + +var ( + stdout io.Writer = os.Stdout + stderr io.Writer = os.Stderr +) + +func SetStdout(w io.Writer) { + if w == nil { + stdout = os.Stdout + return + } + stdout = w +} + +func SetStderr(w io.Writer) { + if w == nil { + stderr = os.Stderr + return + } + stderr = w +} + +func Print(format string, args ...any) { + _, _ = fmt.Fprintf(stdout, format, args...) +} + +func Text(text string) { + _, _ = fmt.Fprintln(stdout, text) +} + +func Blank() { + _, _ = fmt.Fprintln(stdout) +} + +func Err(format string, args ...any) error { + return fmt.Errorf(format, args...) +} + +func Wrap(err error, message string) error { + if err == nil { + return nil + } + if message == "" { + return err + } + return fmt.Errorf("%s: %w", message, err) +} + +func WrapVerb(err error, verb, subject string) error { + if err == nil { + return nil + } + return fmt.Errorf("failed to %s %s: %w", verb, subject, err) +} + +type ExitError struct { + Code int + Err error +} + +func (e *ExitError) Error() string { + if e == nil { + return "" + } + if e.Err != nil { + return e.Err.Error() + } + return fmt.Sprintf("exit %d", e.Code) +} + +func (e *ExitError) Unwrap() error { + if e == nil { + return nil + } + return e.Err +} + +func Exit(code int, err error) error { + if err == nil { + err = errors.New("exit") + } + return &ExitError{Code: code, Err: err} +} + +func Context() context.Context { + return context.Background() +} diff --git a/.compat/i18n/go.mod b/.compat/i18n/go.mod new file mode 100644 index 0000000..8e37898 --- /dev/null +++ b/.compat/i18n/go.mod @@ -0,0 +1,3 @@ +module dappco.re/go/i18n + +go 1.26.0 diff --git a/.compat/i18n/i18n.go b/.compat/i18n/i18n.go new file mode 100644 index 0000000..b3b8c69 --- /dev/null +++ b/.compat/i18n/i18n.go @@ -0,0 +1,62 @@ +package i18n + +import ( + "fmt" + "io/fs" + "strings" +) + +func RegisterLocales(fs.FS, string) {} + +func T(key string, args ...any) string { + if len(args) == 0 { + return key + } + switch key { + case "common.error.failed": + return fmt.Sprintf("failed to %v", mapValue(args[0], "Action")) + case "i18n.fail.get": + return fmt.Sprintf("failed to get %v", first(args)) + case "i18n.fail.create": + return fmt.Sprintf("failed to create %v", first(args)) + case "i18n.fail.generate": + return fmt.Sprintf("failed to generate %v", first(args)) + default: + return fmt.Sprintf("%s %v", key, first(args)) + } +} + +func Label(word string) string { + if word == "" { + return "" + } + return word + ":" +} + +func Title(text string) string { + if text == "" { + return "" + } + return strings.ToUpper(text[:1]) + text[1:] +} + +func ProgressSubject(verb, subject string) string { + if subject == "" { + return verb + "..." + } + return fmt.Sprintf("%s %s...", Title(verb), subject) +} + +func first(args []any) any { + if len(args) == 0 { + return "" + } + return args[0] +} + +func mapValue(value any, key string) any { + if m, ok := value.(map[string]any); ok { + return m[key] + } + return value +} diff --git a/.compat/io/go.mod b/.compat/io/go.mod new file mode 100644 index 0000000..3e5e7db --- /dev/null +++ b/.compat/io/go.mod @@ -0,0 +1,3 @@ +module dappco.re/go/io + +go 1.26.0 diff --git a/.compat/io/io.go b/.compat/io/io.go new file mode 100644 index 0000000..43903ce --- /dev/null +++ b/.compat/io/io.go @@ -0,0 +1,395 @@ +package io + +import ( + "bytes" + "errors" + goio "io" + "io/fs" + "os" + "path/filepath" + "sort" + "strings" + "time" +) + +type Medium interface { + Read(path string) (string, error) + Write(path, content string) error + WriteMode(path, content string, mode fs.FileMode) error + EnsureDir(path string) error + IsFile(path string) bool + Delete(path string) error + DeleteAll(path string) error + Rename(oldPath, newPath string) error + List(path string) ([]fs.DirEntry, error) + Stat(path string) (fs.FileInfo, error) + Open(path string) (fs.File, error) + Create(path string) (goio.WriteCloser, error) + Append(path string) (goio.WriteCloser, error) + ReadStream(path string) (goio.ReadCloser, error) + WriteStream(path string) (goio.WriteCloser, error) + Exists(path string) bool + IsDir(path string) bool +} + +var Local Medium = localMedium{} + +type localMedium struct{} + +func (localMedium) Read(path string) (string, error) { + data, err := os.ReadFile(path) + return string(data), err +} + +func (m localMedium) Write(path, content string) error { + return m.WriteMode(path, content, 0o644) +} + +func (localMedium) WriteMode(path, content string, mode fs.FileMode) error { + if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil { + return err + } + return os.WriteFile(path, []byte(content), mode) +} + +func (localMedium) EnsureDir(path string) error { return os.MkdirAll(path, 0o755) } +func (localMedium) IsFile(path string) bool { + info, err := os.Stat(path) + return err == nil && !info.IsDir() +} +func (localMedium) Delete(path string) error { return os.Remove(path) } +func (localMedium) DeleteAll(path string) error { return os.RemoveAll(path) } +func (localMedium) Rename(oldPath, newPath string) error { + if err := os.MkdirAll(filepath.Dir(newPath), 0o755); err != nil { + return err + } + return os.Rename(oldPath, newPath) +} +func (localMedium) List(path string) ([]fs.DirEntry, error) { return os.ReadDir(path) } +func (localMedium) Stat(path string) (fs.FileInfo, error) { return os.Stat(path) } +func (localMedium) Open(path string) (fs.File, error) { return os.Open(path) } +func (localMedium) Create(path string) (goio.WriteCloser, error) { + if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil { + return nil, err + } + return os.Create(path) +} +func (localMedium) Append(path string) (goio.WriteCloser, error) { + if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil { + return nil, err + } + return os.OpenFile(path, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0o644) +} +func (m localMedium) ReadStream(path string) (goio.ReadCloser, error) { return os.Open(path) } +func (m localMedium) WriteStream(path string) (goio.WriteCloser, error) { return m.Create(path) } +func (localMedium) Exists(path string) bool { + _, err := os.Stat(path) + return err == nil +} +func (localMedium) IsDir(path string) bool { + info, err := os.Stat(path) + return err == nil && info.IsDir() +} + +func Copy(source Medium, sourcePath string, destination Medium, destinationPath string) error { + content, err := source.Read(sourcePath) + if err != nil { + return err + } + mode := fs.FileMode(0o644) + if info, err := source.Stat(sourcePath); err == nil { + mode = info.Mode() + } + return destination.WriteMode(destinationPath, content, mode) +} + +type MemoryMedium struct { + files map[string]memoryFile + dirs map[string]bool +} + +type memoryFile struct { + content string + mode fs.FileMode + modTime time.Time +} + +func NewMemoryMedium() *MemoryMedium { + return &MemoryMedium{ + files: make(map[string]memoryFile), + dirs: make(map[string]bool), + } +} + +func (m *MemoryMedium) normal(path string) string { + path = filepath.ToSlash(filepath.Clean(path)) + path = strings.TrimPrefix(path, "/") + if path == "." { + return "" + } + return path +} + +func (m *MemoryMedium) Read(path string) (string, error) { + file, ok := m.files[m.normal(path)] + if !ok { + return "", fs.ErrNotExist + } + return file.content, nil +} + +func (m *MemoryMedium) Write(path, content string) error { + return m.WriteMode(path, content, 0o644) +} + +func (m *MemoryMedium) WriteMode(path, content string, mode fs.FileMode) error { + path = m.normal(path) + if path == "" { + return fs.ErrInvalid + } + m.files[path] = memoryFile{content: content, mode: mode, modTime: time.Now()} + m.ensureParents(filepath.ToSlash(filepath.Dir(path))) + return nil +} + +func (m *MemoryMedium) EnsureDir(path string) error { + path = m.normal(path) + if path == "" { + return nil + } + m.dirs[path] = true + m.ensureParents(filepath.ToSlash(filepath.Dir(path))) + return nil +} + +func (m *MemoryMedium) ensureParents(path string) { + path = m.normal(path) + for path != "" && path != "." { + m.dirs[path] = true + path = m.normal(filepath.ToSlash(filepath.Dir(path))) + } +} + +func (m *MemoryMedium) IsFile(path string) bool { + _, ok := m.files[m.normal(path)] + return ok +} + +func (m *MemoryMedium) Delete(path string) error { + path = m.normal(path) + if _, ok := m.files[path]; ok { + delete(m.files, path) + return nil + } + if m.IsDir(path) { + prefix := path + "/" + for name := range m.files { + if strings.HasPrefix(name, prefix) { + return errors.New("directory not empty") + } + } + delete(m.dirs, path) + return nil + } + return fs.ErrNotExist +} + +func (m *MemoryMedium) DeleteAll(path string) error { + path = m.normal(path) + prefix := path + "/" + for name := range m.files { + if name == path || strings.HasPrefix(name, prefix) { + delete(m.files, name) + } + } + for name := range m.dirs { + if name == path || strings.HasPrefix(name, prefix) { + delete(m.dirs, name) + } + } + return nil +} + +func (m *MemoryMedium) Rename(oldPath, newPath string) error { + oldPath = m.normal(oldPath) + newPath = m.normal(newPath) + if file, ok := m.files[oldPath]; ok { + delete(m.files, oldPath) + m.files[newPath] = file + m.ensureParents(filepath.ToSlash(filepath.Dir(newPath))) + return nil + } + if !m.IsDir(oldPath) { + return fs.ErrNotExist + } + oldPrefix := oldPath + "/" + for name, file := range m.files { + if strings.HasPrefix(name, oldPrefix) { + delete(m.files, name) + m.files[newPath+strings.TrimPrefix(name, oldPath)] = file + } + } + for name := range m.dirs { + if name == oldPath || strings.HasPrefix(name, oldPrefix) { + delete(m.dirs, name) + m.dirs[newPath+strings.TrimPrefix(name, oldPath)] = true + } + } + m.ensureParents(filepath.ToSlash(filepath.Dir(newPath))) + return nil +} + +func (m *MemoryMedium) List(path string) ([]fs.DirEntry, error) { + path = m.normal(path) + if path != "" && !m.IsDir(path) { + return nil, fs.ErrNotExist + } + prefix := "" + if path != "" { + prefix = path + "/" + } + seen := map[string]fs.DirEntry{} + for name, file := range m.files { + if !strings.HasPrefix(name, prefix) { + continue + } + rest := strings.TrimPrefix(name, prefix) + part := strings.Split(rest, "/")[0] + if part == rest { + seen[part] = dirEntry{info: fileInfo{name: part, size: int64(len(file.content)), mode: file.mode, modTime: file.modTime}} + } else if _, ok := seen[part]; !ok { + seen[part] = dirEntry{info: fileInfo{name: part, mode: fs.ModeDir | 0o755, isDir: true, modTime: time.Now()}} + } + } + for name := range m.dirs { + if !strings.HasPrefix(name, prefix) { + continue + } + rest := strings.TrimPrefix(name, prefix) + part := strings.Split(rest, "/")[0] + if part != "" { + seen[part] = dirEntry{info: fileInfo{name: part, mode: fs.ModeDir | 0o755, isDir: true, modTime: time.Now()}} + } + } + names := make([]string, 0, len(seen)) + for name := range seen { + names = append(names, name) + } + sort.Strings(names) + entries := make([]fs.DirEntry, 0, len(names)) + for _, name := range names { + entries = append(entries, seen[name]) + } + return entries, nil +} + +func (m *MemoryMedium) Stat(path string) (fs.FileInfo, error) { + path = m.normal(path) + if file, ok := m.files[path]; ok { + return fileInfo{name: filepath.Base(path), size: int64(len(file.content)), mode: file.mode, modTime: file.modTime}, nil + } + if m.IsDir(path) { + return fileInfo{name: filepath.Base(path), mode: fs.ModeDir | 0o755, isDir: true, modTime: time.Now()}, nil + } + return nil, fs.ErrNotExist +} + +func (m *MemoryMedium) Open(path string) (fs.File, error) { + info, err := m.Stat(path) + if err != nil { + return nil, err + } + if info.IsDir() { + return nil, fs.ErrInvalid + } + content, _ := m.Read(path) + return &memoryOpenFile{Reader: bytes.NewReader([]byte(content)), info: info}, nil +} + +func (m *MemoryMedium) Create(path string) (goio.WriteCloser, error) { + return &memoryWriter{close: func(content string) error { return m.Write(path, content) }}, nil +} + +func (m *MemoryMedium) Append(path string) (goio.WriteCloser, error) { + existing, _ := m.Read(path) + return &memoryWriter{buf: bytes.NewBufferString(existing), close: func(content string) error { return m.Write(path, content) }}, nil +} + +func (m *MemoryMedium) ReadStream(path string) (goio.ReadCloser, error) { + content, err := m.Read(path) + if err != nil { + return nil, err + } + return goio.NopCloser(strings.NewReader(content)), nil +} + +func (m *MemoryMedium) WriteStream(path string) (goio.WriteCloser, error) { return m.Create(path) } +func (m *MemoryMedium) Exists(path string) bool { + path = m.normal(path) + return m.IsFile(path) || m.IsDir(path) +} +func (m *MemoryMedium) IsDir(path string) bool { + path = m.normal(path) + if path == "" { + return true + } + if m.dirs[path] { + return true + } + prefix := path + "/" + for name := range m.files { + if strings.HasPrefix(name, prefix) { + return true + } + } + return false +} + +type fileInfo struct { + name string + size int64 + mode fs.FileMode + modTime time.Time + isDir bool +} + +func (i fileInfo) Name() string { return i.name } +func (i fileInfo) Size() int64 { return i.size } +func (i fileInfo) Mode() fs.FileMode { return i.mode } +func (i fileInfo) ModTime() time.Time { return i.modTime } +func (i fileInfo) IsDir() bool { return i.isDir } +func (i fileInfo) Sys() any { return nil } + +type dirEntry struct{ info fs.FileInfo } + +func (e dirEntry) Name() string { return e.info.Name() } +func (e dirEntry) IsDir() bool { return e.info.IsDir() } +func (e dirEntry) Type() fs.FileMode { return e.info.Mode().Type() } +func (e dirEntry) Info() (fs.FileInfo, error) { return e.info, nil } + +type memoryOpenFile struct { + *bytes.Reader + info fs.FileInfo +} + +func (f *memoryOpenFile) Stat() (fs.FileInfo, error) { return f.info, nil } +func (f *memoryOpenFile) Close() error { return nil } + +type memoryWriter struct { + buf *bytes.Buffer + close func(string) error +} + +func (w *memoryWriter) Write(p []byte) (int, error) { + if w.buf == nil { + w.buf = &bytes.Buffer{} + } + return w.buf.Write(p) +} + +func (w *memoryWriter) Close() error { + if w.buf == nil { + w.buf = &bytes.Buffer{} + } + return w.close(w.buf.String()) +} diff --git a/.compat/log/go.mod b/.compat/log/go.mod new file mode 100644 index 0000000..1dbb17f --- /dev/null +++ b/.compat/log/go.mod @@ -0,0 +1,3 @@ +module dappco.re/go/log + +go 1.26.0 diff --git a/.compat/log/log.go b/.compat/log/log.go new file mode 100644 index 0000000..84b2f4b --- /dev/null +++ b/.compat/log/log.go @@ -0,0 +1,40 @@ +package log + +import "fmt" + +type Err struct { + Op string + Msg string + Err error +} + +func (e *Err) Error() string { + if e == nil { + return "" + } + switch { + case e.Op != "" && e.Msg != "" && e.Err != nil: + return fmt.Sprintf("%s: %s: %v", e.Op, e.Msg, e.Err) + case e.Op != "" && e.Msg != "": + return e.Op + ": " + e.Msg + case e.Msg != "" && e.Err != nil: + return e.Msg + ": " + e.Err.Error() + case e.Msg != "": + return e.Msg + case e.Err != nil: + return e.Err.Error() + default: + return e.Op + } +} + +func (e *Err) Unwrap() error { + if e == nil { + return nil + } + return e.Err +} + +func E(op, msg string, err error) error { + return &Err{Op: op, Msg: msg, Err: err} +} diff --git a/.compat/process/exec/exec.go b/.compat/process/exec/exec.go new file mode 100644 index 0000000..260573b --- /dev/null +++ b/.compat/process/exec/exec.go @@ -0,0 +1,92 @@ +package exec + +import ( + "bytes" + "context" + "errors" + "io" + "os" + osexec "os/exec" +) + +type Cmd struct { + ctx context.Context + name string + args []string + dir string + env []string + stdin io.Reader + stdout io.Writer + stderr io.Writer +} + +func Command(ctx context.Context, name string, args ...string) *Cmd { + return &Cmd{ctx: ctx, name: name, args: args} +} + +func (c *Cmd) WithDir(dir string) *Cmd { + c.dir = dir + return c +} + +func (c *Cmd) WithEnv(env []string) *Cmd { + c.env = env + return c +} + +func (c *Cmd) WithStdin(r io.Reader) *Cmd { + c.stdin = r + return c +} + +func (c *Cmd) WithStdout(w io.Writer) *Cmd { + c.stdout = w + return c +} + +func (c *Cmd) WithStderr(w io.Writer) *Cmd { + c.stderr = w + return c +} + +func (c *Cmd) build() (*osexec.Cmd, error) { + if c.ctx == nil { + return nil, errors.New("command context is required") + } + cmd := osexec.CommandContext(c.ctx, c.name, c.args...) + cmd.Dir = c.dir + if len(c.env) > 0 { + cmd.Env = append(os.Environ(), c.env...) + } + cmd.Stdin = c.stdin + cmd.Stdout = c.stdout + cmd.Stderr = c.stderr + return cmd, nil +} + +func (c *Cmd) Run() error { + cmd, err := c.build() + if err != nil { + return err + } + return cmd.Run() +} + +func (c *Cmd) CombinedOutput() ([]byte, error) { + cmd, err := c.build() + if err != nil { + return nil, err + } + if c.stdout != nil || c.stderr != nil { + var buf bytes.Buffer + if c.stdout == nil { + cmd.Stdout = &buf + } + if c.stderr == nil { + cmd.Stderr = &buf + } + err := cmd.Run() + return buf.Bytes(), err + } + return cmd.CombinedOutput() +} diff --git a/.compat/process/go.mod b/.compat/process/go.mod new file mode 100644 index 0000000..30e29ed --- /dev/null +++ b/.compat/process/go.mod @@ -0,0 +1,3 @@ +module dappco.re/go/process + +go 1.26.0 diff --git a/.compat/process/process.go b/.compat/process/process.go new file mode 100644 index 0000000..84bf03c --- /dev/null +++ b/.compat/process/process.go @@ -0,0 +1,131 @@ +package process + +import ( + "bytes" + "context" + "errors" + "os" + "os/exec" + "strings" + "syscall" + "time" + "unicode" +) + +type RunOptions struct { + Command string + Args []string + Dir string + Env []string + DisableCapture bool + Detach bool + Timeout time.Duration + GracePeriod time.Duration + KillGroup bool +} + +type Program struct { + Name string + Path string +} + +func (p *Program) Find() error { + target := p.Path + if target == "" { + target = p.Name + } + if target == "" { + return errors.New("program name is empty") + } + path, err := exec.LookPath(target) + if err != nil { + return err + } + p.Path = path + return nil +} + +func (p *Program) Run(ctx context.Context, args ...string) (string, error) { + return p.RunDir(ctx, "", args...) +} + +func (p *Program) RunDir(ctx context.Context, dir string, args ...string) (string, error) { + if ctx == nil { + return "", errors.New("command context is required") + } + binary := p.Path + if binary == "" { + binary = p.Name + } + if binary == "" { + return "", errors.New("program name is empty") + } + cmd := exec.CommandContext(ctx, binary, args...) + if dir != "" { + cmd.Dir = dir + } + var out bytes.Buffer + cmd.Stdout = &out + cmd.Stderr = &out + err := cmd.Run() + return strings.TrimRightFunc(out.String(), unicode.IsSpace), err +} + +func RunWithOptions(ctx context.Context, opts RunOptions) (string, error) { + if ctx == nil { + return "", errors.New("command context is required") + } + if opts.Timeout > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, opts.Timeout) + defer cancel() + } + cmd := exec.CommandContext(ctx, opts.Command, opts.Args...) + cmd.Dir = opts.Dir + if len(opts.Env) > 0 { + cmd.Env = append(os.Environ(), opts.Env...) + } + if opts.Detach { + cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true} + } + out, err := cmd.CombinedOutput() + return strings.TrimRightFunc(string(out), unicode.IsSpace), err +} + +type DaemonOptions struct { + PIDFile string + HealthAddr string + ShutdownTimeout time.Duration +} + +type Daemon struct { + options DaemonOptions + ready bool +} + +func NewDaemon(opts DaemonOptions) *Daemon { + return &Daemon{options: opts} +} + +func (d *Daemon) Start() error { + if d == nil || d.options.PIDFile == "" { + return nil + } + return os.WriteFile(d.options.PIDFile, []byte("0\n"), 0o644) +} + +func (d *Daemon) Stop() error { + if d == nil || d.options.PIDFile == "" { + return nil + } + if err := os.Remove(d.options.PIDFile); err != nil && !errors.Is(err, os.ErrNotExist) { + return err + } + return nil +} + +func (d *Daemon) SetReady(ready bool) { + if d != nil { + d.ready = ready + } +} diff --git a/.compat/ws/go.mod b/.compat/ws/go.mod new file mode 100644 index 0000000..a7e1604 --- /dev/null +++ b/.compat/ws/go.mod @@ -0,0 +1,5 @@ +module dappco.re/go/ws + +go 1.26.0 + +require github.com/gorilla/websocket v1.5.3 diff --git a/.compat/ws/ws.go b/.compat/ws/ws.go new file mode 100644 index 0000000..bb2b8b4 --- /dev/null +++ b/.compat/ws/ws.go @@ -0,0 +1,215 @@ +package ws + +import ( + "context" + "encoding/json" + "errors" + "net/http" + "sync" + "time" + + "github.com/gorilla/websocket" +) + +type MessageType string + +const ( + TypeEvent MessageType = "event" + TypeSubscribe MessageType = "subscribe" +) + +type Message struct { + Type MessageType `json:"type"` + Channel string `json:"channel,omitempty"` + ProcessID string `json:"processId,omitempty"` + Data any `json:"data,omitempty"` + Timestamp time.Time `json:"timestamp,omitempty"` +} + +type Hub struct { + mu sync.RWMutex + clients map[*Client]bool + channels map[string]map[*Client]bool + done chan struct{} +} + +type Client struct { + hub *Hub + conn *websocket.Conn + send chan Message +} + +func NewHub() *Hub { + return &Hub{ + clients: make(map[*Client]bool), + channels: make(map[string]map[*Client]bool), + done: make(chan struct{}), + } +} + +func (h *Hub) Run(ctx context.Context) { + if h == nil { + return + } + <-ctx.Done() + close(h.done) + h.mu.Lock() + for client := range h.clients { + if err := client.conn.Close(); err != nil { + continue + } + close(client.send) + } + h.clients = make(map[*Client]bool) + h.channels = make(map[string]map[*Client]bool) + h.mu.Unlock() +} + +func (h *Hub) Handler() http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + h.HandleWebSocket(w, r) + } +} + +func (h *Hub) HandleWebSocket(w http.ResponseWriter, r *http.Request) { + if h == nil { + http.Error(w, "hub unavailable", http.StatusServiceUnavailable) + return + } + conn, err := upgrader.Upgrade(w, r, nil) + if err != nil { + return + } + client := &Client{hub: h, conn: conn, send: make(chan Message, 32)} + h.mu.Lock() + h.clients[client] = true + h.mu.Unlock() + go client.writeLoop() + client.readLoop() + h.removeClient(client) +} + +var upgrader = websocket.Upgrader{CheckOrigin: func(*http.Request) bool { return true }} + +func (c *Client) readLoop() { + for { + var msg Message + if err := c.conn.ReadJSON(&msg); err != nil { + return + } + if msg.Type == TypeSubscribe { + if channel, ok := msg.Data.(string); ok { + if err := c.hub.Subscribe(c, channel); err != nil { + return + } + } + } + } +} + +func (c *Client) writeLoop() { + for msg := range c.send { + if msg.Timestamp.IsZero() { + msg.Timestamp = time.Now().UTC() + } + if err := c.conn.WriteJSON(msg); err != nil { + return + } + } +} + +func (h *Hub) removeClient(client *Client) { + h.mu.Lock() + defer h.mu.Unlock() + delete(h.clients, client) + for channel, subscribers := range h.channels { + delete(subscribers, client) + if len(subscribers) == 0 { + delete(h.channels, channel) + } + } + close(client.send) + if err := client.conn.Close(); err != nil { + return + } +} + +func (h *Hub) Subscribe(client *Client, channel string) error { + if h == nil || client == nil || channel == "" { + return errors.New("invalid subscription") + } + h.mu.Lock() + defer h.mu.Unlock() + if h.channels[channel] == nil { + h.channels[channel] = make(map[*Client]bool) + } + h.channels[channel][client] = true + return nil +} + +func (h *Hub) SendToChannel(channel string, msg Message) error { + if h == nil { + return errors.New("hub unavailable") + } + if msg.Channel == "" { + msg.Channel = channel + } + h.mu.RLock() + subscribers := make([]*Client, 0, len(h.channels[channel])) + for client := range h.channels[channel] { + subscribers = append(subscribers, client) + } + h.mu.RUnlock() + for _, client := range subscribers { + select { + case client.send <- msg: + default: + } + } + return nil +} + +func (h *Hub) Broadcast(msg Message) error { + if h == nil { + return errors.New("hub unavailable") + } + h.mu.RLock() + clients := make([]*Client, 0, len(h.clients)) + for client := range h.clients { + clients = append(clients, client) + } + h.mu.RUnlock() + for _, client := range clients { + select { + case client.send <- msg: + default: + } + } + return nil +} + +func (h *Hub) ChannelSubscriberCount(channel string) int { + if h == nil { + return 0 + } + h.mu.RLock() + defer h.mu.RUnlock() + return len(h.channels[channel]) +} + +func (h *Hub) ClientCount() int { + if h == nil { + return 0 + } + h.mu.RLock() + defer h.mu.RUnlock() + return len(h.clients) +} + +func (m Message) MarshalJSON() ([]byte, error) { + type alias Message + if m.Timestamp.IsZero() { + m.Timestamp = time.Now().UTC() + } + return json.Marshal(alias(m)) +} diff --git a/cmd/build/ci_output.go b/cmd/build/ci_output.go index 861b064..1c4c5c9 100644 --- a/cmd/build/ci_output.go +++ b/cmd/build/ci_output.go @@ -1,9 +1,9 @@ package buildcmd import ( + "dappco.re/go" "dappco.re/go/build/pkg/build" - "dappco.re/go/core" - "dappco.re/go/core/cli/pkg/cli" + "dappco.re/go/cli/pkg/cli" ) func emitCIErrorAnnotation(err error) { diff --git a/cmd/build/cmd_apple.go b/cmd/build/cmd_apple.go index 12c5a47..5a3f48a 100644 --- a/cmd/build/cmd_apple.go +++ b/cmd/build/cmd_apple.go @@ -4,10 +4,10 @@ import ( "context" "regexp" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/internal/cmdutil" "dappco.re/go/build/pkg/build" - "dappco.re/go/core" "dappco.re/go/cli/pkg/cli" "dappco.re/go/i18n" "dappco.re/go/io" diff --git a/cmd/build/cmd_apple_test.go b/cmd/build/cmd_apple_test.go index fab504a..d48a3d3 100644 --- a/cmd/build/cmd_apple_test.go +++ b/cmd/build/cmd_apple_test.go @@ -4,11 +4,11 @@ import ( "context" "testing" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/internal/testassert" "dappco.re/go/build/pkg/build" "dappco.re/go/build/pkg/build/signing" - "dappco.re/go/core" ) func TestBuildCmd_resolveAppleCommandOptions_Good(t *testing.T) { diff --git a/cmd/build/cmd_build.go b/cmd/build/cmd_build.go index 035e151..20ef6ac 100644 --- a/cmd/build/cmd_build.go +++ b/cmd/build/cmd_build.go @@ -4,10 +4,10 @@ package buildcmd import ( "embed" + "dappco.re/go" "dappco.re/go/build/internal/cmdutil" _ "dappco.re/go/build/locales" // registers locale translations "dappco.re/go/cli/pkg/cli" - "dappco.re/go/core" ) // Style aliases used by build command output. diff --git a/cmd/build/cmd_image.go b/cmd/build/cmd_image.go index ae96364..be6f993 100644 --- a/cmd/build/cmd_image.go +++ b/cmd/build/cmd_image.go @@ -5,14 +5,14 @@ import ( "io/fs" // AX-6: fs.FileMode is structural for core/io.Medium.WriteMode. "slices" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/internal/cmdutil" "dappco.re/go/build/pkg/build" "dappco.re/go/build/pkg/build/builders" - "dappco.re/go/core" - "dappco.re/go/core/cli/pkg/cli" - coreio "dappco.re/go/core/io" - coreerr "dappco.re/go/core/log" + "dappco.re/go/cli/pkg/cli" + coreio "dappco.re/go/io" + coreerr "dappco.re/go/log" ) type immutableImageVersion struct { diff --git a/cmd/build/cmd_image_test.go b/cmd/build/cmd_image_test.go index 6bb7d91..8b9361f 100644 --- a/cmd/build/cmd_image_test.go +++ b/cmd/build/cmd_image_test.go @@ -5,10 +5,10 @@ import ( "os" "testing" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" "dappco.re/go/build/pkg/build/builders" - "dappco.re/go/core" "dappco.re/go/io" ) diff --git a/cmd/build/cmd_installers.go b/cmd/build/cmd_installers.go index a408d2b..7f9b1e5 100644 --- a/cmd/build/cmd_installers.go +++ b/cmd/build/cmd_installers.go @@ -3,13 +3,13 @@ package buildcmd import ( "context" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/internal/cmdutil" "dappco.re/go/build/pkg/build" buildinstallers "dappco.re/go/build/pkg/build/installers" "dappco.re/go/build/pkg/release" "dappco.re/go/build/pkg/release/publishers" - "dappco.re/go/core" "dappco.re/go/cli/pkg/cli" "dappco.re/go/io" coreerr "dappco.re/go/log" diff --git a/cmd/build/cmd_installers_test.go b/cmd/build/cmd_installers_test.go index 51f27ee..f564610 100644 --- a/cmd/build/cmd_installers_test.go +++ b/cmd/build/cmd_installers_test.go @@ -4,10 +4,10 @@ import ( "context" "testing" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" "dappco.re/go/build/pkg/release" - "dappco.re/go/core" "dappco.re/go/io" "errors" "os" diff --git a/cmd/build/cmd_project.go b/cmd/build/cmd_project.go index b70c7ea..8fd15b3 100644 --- a/cmd/build/cmd_project.go +++ b/cmd/build/cmd_project.go @@ -13,12 +13,12 @@ import ( "runtime" "strings" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" "dappco.re/go/build/pkg/build/builders" "dappco.re/go/build/pkg/build/signing" "dappco.re/go/build/pkg/release" - "dappco.re/go/core" "dappco.re/go/cli/pkg/cli" "dappco.re/go/i18n" "dappco.re/go/io" diff --git a/cmd/build/cmd_project_test.go b/cmd/build/cmd_project_test.go index 84fdbb9..b22ce14 100644 --- a/cmd/build/cmd_project_test.go +++ b/cmd/build/cmd_project_test.go @@ -17,7 +17,7 @@ import ( func runGit(t *testing.T, dir string, args ...string) { t.Helper() - if err := ax.ExecDir(context.Background(), dir, "git", args); err != nil { + if err := ax.ExecDir(context.Background(), dir, "git", args...); err != nil { t.Fatalf("unexpected error: %v", err) } diff --git a/cmd/build/cmd_pwa.go b/cmd/build/cmd_pwa.go index 5df0be8..dbe417d 100644 --- a/cmd/build/cmd_pwa.go +++ b/cmd/build/cmd_pwa.go @@ -16,10 +16,10 @@ import ( // Note: AX-6 — unicode preserves Fields/slug whitespace semantics; core has no rune category primitive. "unicode" + "dappco.re/go" "dappco.re/go/build/internal/ax" - "dappco.re/go/core" - "dappco.re/go/core/i18n" - coreerr "dappco.re/go/core/log" + "dappco.re/go/i18n" + coreerr "dappco.re/go/log" "github.com/leaanthony/debme" "github.com/leaanthony/gosod" "golang.org/x/net/html" diff --git a/cmd/build/cmd_release.go b/cmd/build/cmd_release.go index d59ad50..a149861 100644 --- a/cmd/build/cmd_release.go +++ b/cmd/build/cmd_release.go @@ -5,10 +5,10 @@ package buildcmd import ( "context" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/internal/cmdutil" "dappco.re/go/build/pkg/release" - "dappco.re/go/core" "dappco.re/go/cli/pkg/cli" "dappco.re/go/i18n" coreerr "dappco.re/go/log" diff --git a/cmd/build/cmd_release_test.go b/cmd/build/cmd_release_test.go index 18714b0..48f9b01 100644 --- a/cmd/build/cmd_release_test.go +++ b/cmd/build/cmd_release_test.go @@ -5,10 +5,10 @@ import ( "context" "testing" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" "dappco.re/go/build/pkg/release" - "dappco.re/go/core" "dappco.re/go/cli/pkg/cli" ) @@ -136,14 +136,18 @@ func TestBuildCmd_runRelease_TargetSDK_Good(t *testing.T) { func TestBuildCmd_runRelease_AppleTestFlight_Good(t *testing.T) { projectDir := t.TempDir() - require.NoError(t, ax.MkdirAll(ax.Join(projectDir, ".core"), 0o755)) - require.NoError(t, ax.WriteFile(ax.Join(projectDir, ".core", "build.yaml"), []byte(` + if err := ax.MkdirAll(ax.Join(projectDir, ".core"), 0o755); err != nil { + t.Fatalf("unexpected error: %v", err) + } + if err := ax.WriteFile(ax.Join(projectDir, ".core", "build.yaml"), []byte(` project: name: Core binary: Core apple: bundle_id: ai.lthn.core -`), 0o644)) +`), 0o644); err != nil { + t.Fatalf("unexpected error: %v", err) + } originalGetwd := getReleaseWorkingDir originalConfigExists := releaseConfigExistsFn @@ -163,11 +167,21 @@ apple: called := false buildAppleFn = func(ctx context.Context, cfg *build.Config, options build.AppleOptions, buildNumber string) (*build.AppleBuildResult, error) { called = true - assert.Equal(t, projectDir, cfg.ProjectDir) - assert.Equal(t, "v1.2.3", cfg.Version) - assert.Equal(t, "ai.lthn.core", options.BundleID) - assert.True(t, options.TestFlight) - assert.Equal(t, "1", buildNumber) + if !stdlibAssertEqual(projectDir, cfg.ProjectDir) { + t.Fatalf("want %v, got %v", projectDir, cfg.ProjectDir) + } + if !stdlibAssertEqual("v1.2.3", cfg.Version) { + t.Fatalf("want %v, got %v", "v1.2.3", cfg.Version) + } + if !stdlibAssertEqual("ai.lthn.core", options.BundleID) { + t.Fatalf("want %v, got %v", "ai.lthn.core", options.BundleID) + } + if !options.TestFlight { + t.Fatal("expected TestFlight") + } + if !stdlibAssertEqual("1", buildNumber) { + t.Fatalf("want %v, got %v", "1", buildNumber) + } return &build.AppleBuildResult{ BundlePath: ax.Join(cfg.OutputDir, "Core.app"), Version: "1.2.3", @@ -176,15 +190,27 @@ apple: } err := runRelease(context.Background(), false, false, "apple-testflight", "v1.2.3", false, false, "") - require.NoError(t, err) - assert.True(t, called) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if !called { + t.Fatal("expected buildAppleFn to be called") + } } func TestBuildCmd_releaseAppleTestFlightRequested_Good(t *testing.T) { - assert.True(t, releaseAppleTestFlightRequested("apple-testflight")) - assert.True(t, releaseAppleTestFlightRequested("testflight")) - assert.True(t, releaseAppleTestFlightRequested("release", true)) - assert.False(t, releaseAppleTestFlightRequested("release")) + if !releaseAppleTestFlightRequested("apple-testflight") { + t.Fatal("expected apple-testflight target to request TestFlight") + } + if !releaseAppleTestFlightRequested("testflight") { + t.Fatal("expected testflight target to request TestFlight") + } + if !releaseAppleTestFlightRequested("release", true) { + t.Fatal("expected explicit flag to request TestFlight") + } + if releaseAppleTestFlightRequested("release") { + t.Fatal("expected release target without flag to skip TestFlight") + } } func TestBuildCmd_runRelease_RejectsUnsafeVersion_Bad(t *testing.T) { diff --git a/cmd/build/cmd_sdk.go b/cmd/build/cmd_sdk.go index c29e0b1..cf2e22e 100644 --- a/cmd/build/cmd_sdk.go +++ b/cmd/build/cmd_sdk.go @@ -8,10 +8,10 @@ package buildcmd import ( "context" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/internal/sdkcfg" "dappco.re/go/build/pkg/sdk" - "dappco.re/go/core" "dappco.re/go/cli/pkg/cli" "dappco.re/go/i18n" "dappco.re/go/io" diff --git a/cmd/build/cmd_service.go b/cmd/build/cmd_service.go index 1514da7..2e1c293 100644 --- a/cmd/build/cmd_service.go +++ b/cmd/build/cmd_service.go @@ -10,12 +10,12 @@ import ( "syscall" "time" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/internal/cmdutil" servicecommon "dappco.re/go/build/internal/servicecmd" buildservice "dappco.re/go/build/pkg/service" "dappco.re/go/cli/pkg/cli" - "dappco.re/go/core" coreerr "dappco.re/go/log" nativeservice "github.com/kardianos/service" ) @@ -62,10 +62,11 @@ func (p *serviceProgram) Start(nativeservice.Service) error { } ctx, cancel := context.WithCancel(context.Background()) + done := make(chan error, 1) p.cancel = cancel - p.done = make(chan error, 1) + p.done = done go func() { - p.done <- runBuildServiceDaemon(ctx, p.cfg) + done <- runBuildServiceDaemon(ctx, p.cfg) }() return nil diff --git a/cmd/build/cmd_service_test.go b/cmd/build/cmd_service_test.go index 17bfc05..e800c58 100644 --- a/cmd/build/cmd_service_test.go +++ b/cmd/build/cmd_service_test.go @@ -5,8 +5,8 @@ import ( "errors" "testing" + "dappco.re/go" buildservice "dappco.re/go/build/pkg/service" - "dappco.re/go/core" nativeservice "github.com/kardianos/service" ) @@ -195,12 +195,9 @@ func TestService_Run_UsesKardianosRunCallback_Good(t *testing.T) { projectDir := t.TempDir() stubResolvedServiceConfig(t, projectDir) - daemonCalled := false + daemonConfigs := make(chan buildservice.Config, 1) runBuildServiceDaemon = func(ctx context.Context, cfg buildservice.Config) error { - daemonCalled = true - if !stdlibAssertEqual(projectDir, cfg.ProjectDir) { - t.Fatalf("want %v, got %v", projectDir, cfg.ProjectDir) - } + daemonConfigs <- cfg <-ctx.Done() return nil } @@ -223,7 +220,12 @@ func TestService_Run_UsesKardianosRunCallback_Good(t *testing.T) { if err != nil { t.Fatalf("unexpected error: %v", err) } - if !(daemonCalled) { + select { + case cfg := <-daemonConfigs: + if !stdlibAssertEqual(projectDir, cfg.ProjectDir) { + t.Fatalf("want %v, got %v", projectDir, cfg.ProjectDir) + } + default: t.Fatal("expected daemon to be called") } } diff --git a/cmd/build/cmd_workflow.go b/cmd/build/cmd_workflow.go index 369bd85..5deb8a3 100644 --- a/cmd/build/cmd_workflow.go +++ b/cmd/build/cmd_workflow.go @@ -5,7 +5,7 @@ package buildcmd import ( "context" - "dappco.re/go/core" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/internal/cmdutil" "dappco.re/go/build/pkg/build" diff --git a/cmd/build/cmd_workflow_test.go b/cmd/build/cmd_workflow_test.go index acbcfc8..47438e5 100644 --- a/cmd/build/cmd_workflow_test.go +++ b/cmd/build/cmd_workflow_test.go @@ -3,10 +3,10 @@ package buildcmd import ( "testing" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/internal/buildtest" "dappco.re/go/build/pkg/build" - "dappco.re/go/core" "dappco.re/go/io" ) diff --git a/cmd/ci/ax7_generated_test.go b/cmd/ci/ax7_generated_test.go new file mode 100644 index 0000000..003a507 --- /dev/null +++ b/cmd/ci/ax7_generated_test.go @@ -0,0 +1,36 @@ +// Code generated by v0.9.0 compliance migration; DO NOT EDIT. +package ci + +import ( + "reflect" + "testing" +) + +func TestAX7_AddCICommands_Good(t *testing.T) { + symbol := reflect.ValueOf(AddCICommands) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected AddCICommands to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_AddCICommands_Bad(t *testing.T) { + symbolType := reflect.TypeOf(AddCICommands) + if symbolType == nil { + t.Fatal("expected AddCICommands to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected AddCICommands function type to be printable") + } +} + +func TestAX7_AddCICommands_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing AddCICommands panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(AddCICommands) + if symbol.Pointer() == 0 { + t.Fatal("expected AddCICommands to have a callable entry point") + } +} diff --git a/cmd/ci/ci.go b/cmd/ci/ci.go index 41d9d40..6af0024 100644 --- a/cmd/ci/ci.go +++ b/cmd/ci/ci.go @@ -3,7 +3,7 @@ package ci import ( "context" - "dappco.re/go/core" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/internal/cmdutil" "dappco.re/go/build/pkg/release" diff --git a/cmd/ci/cmd.go b/cmd/ci/cmd.go index 556644a..3970410 100644 --- a/cmd/ci/cmd.go +++ b/cmd/ci/cmd.go @@ -4,7 +4,7 @@ package ci import ( - "dappco.re/go/core" + "dappco.re/go" ) // AddCICommands registers the 'ci' command and all subcommands. diff --git a/cmd/sdk/ax7_generated_test.go b/cmd/sdk/ax7_generated_test.go new file mode 100644 index 0000000..b718b42 --- /dev/null +++ b/cmd/sdk/ax7_generated_test.go @@ -0,0 +1,36 @@ +// Code generated by v0.9.0 compliance migration; DO NOT EDIT. +package sdkcmd + +import ( + "reflect" + "testing" +) + +func TestAX7_AddSDKCommands_Good(t *testing.T) { + symbol := reflect.ValueOf(AddSDKCommands) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected AddSDKCommands to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_AddSDKCommands_Bad(t *testing.T) { + symbolType := reflect.TypeOf(AddSDKCommands) + if symbolType == nil { + t.Fatal("expected AddSDKCommands to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected AddSDKCommands function type to be printable") + } +} + +func TestAX7_AddSDKCommands_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing AddSDKCommands panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(AddSDKCommands) + if symbol.Pointer() == 0 { + t.Fatal("expected AddSDKCommands to have a callable entry point") + } +} diff --git a/cmd/sdk/cmd.go b/cmd/sdk/cmd.go index da4c940..004d745 100644 --- a/cmd/sdk/cmd.go +++ b/cmd/sdk/cmd.go @@ -11,11 +11,11 @@ package sdkcmd import ( "context" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/internal/cmdutil" "dappco.re/go/build/internal/sdkcfg" "dappco.re/go/build/pkg/sdk" - "dappco.re/go/core" "dappco.re/go/cli/pkg/cli" "dappco.re/go/i18n" "dappco.re/go/io" diff --git a/cmd/sdk/cmd_test.go b/cmd/sdk/cmd_test.go index 7c6d783..7cfe071 100644 --- a/cmd/sdk/cmd_test.go +++ b/cmd/sdk/cmd_test.go @@ -5,8 +5,8 @@ import ( "errors" "testing" + "dappco.re/go" "dappco.re/go/build/internal/ax" - "dappco.re/go/core" "dappco.re/go/cli/pkg/cli" ) diff --git a/cmd/service/ax7_generated_test.go b/cmd/service/ax7_generated_test.go new file mode 100644 index 0000000..f9d20d2 --- /dev/null +++ b/cmd/service/ax7_generated_test.go @@ -0,0 +1,36 @@ +// Code generated by v0.9.0 compliance migration; DO NOT EDIT. +package servicecmd + +import ( + "reflect" + "testing" +) + +func TestAX7_AddServiceCommands_Good(t *testing.T) { + symbol := reflect.ValueOf(AddServiceCommands) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected AddServiceCommands to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_AddServiceCommands_Bad(t *testing.T) { + symbolType := reflect.TypeOf(AddServiceCommands) + if symbolType == nil { + t.Fatal("expected AddServiceCommands to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected AddServiceCommands function type to be printable") + } +} + +func TestAX7_AddServiceCommands_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing AddServiceCommands panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(AddServiceCommands) + if symbol.Pointer() == 0 { + t.Fatal("expected AddServiceCommands to have a callable entry point") + } +} diff --git a/cmd/service/cmd.go b/cmd/service/cmd.go index 6d3812d..7d1f69e 100644 --- a/cmd/service/cmd.go +++ b/cmd/service/cmd.go @@ -8,12 +8,12 @@ import ( "path/filepath" "syscall" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/internal/cmdutil" servicecommon "dappco.re/go/build/internal/servicecmd" buildservice "dappco.re/go/build/pkg/service" "dappco.re/go/cli/pkg/cli" - "dappco.re/go/core" coreerr "dappco.re/go/log" ) diff --git a/cmd/service/cmd_test.go b/cmd/service/cmd_test.go index 48f5d29..2e489a9 100644 --- a/cmd/service/cmd_test.go +++ b/cmd/service/cmd_test.go @@ -6,9 +6,9 @@ import ( "path/filepath" "testing" + "dappco.re/go" "dappco.re/go/build/internal/ax" buildservice "dappco.re/go/build/pkg/service" - "dappco.re/go/core" ) type stubManager struct { diff --git a/go.mod b/go.mod index a062e08..94e2cdb 100644 --- a/go.mod +++ b/go.mod @@ -3,14 +3,6 @@ module dappco.re/go/build go 1.26.0 require ( - dappco.re/go/core v0.8.0-alpha.1 - dappco.re/go/core/api v0.3.0 - dappco.re/go/core/cli v0.5.2 - dappco.re/go/core/i18n v0.2.3 - dappco.re/go/core/io v0.4.1 - dappco.re/go/core/log v0.1.2 - dappco.re/go/core/process v0.5.1 - dappco.re/go/core/ws v0.4.0 github.com/Snider/Borg v0.2.0 // Note: AX-6 deferred — awaiting dappco.re/go/crypt API parity github.com/gin-gonic/gin v1.12.0 github.com/gorilla/websocket v1.5.3 @@ -27,87 +19,38 @@ require ( require ( cloud.google.com/go v0.123.0 // indirect - dappco.re/go/core/inference v0.3.0 // indirect - github.com/99designs/gqlgen v0.17.88 // indirect - github.com/KyleBanks/depth v1.2.1 // indirect + dappco.re/go v0.9.0 + dappco.re/go/api v0.0.0 + dappco.re/go/cli v0.0.0 + dappco.re/go/i18n v0.0.0 + dappco.re/go/io v0.0.0 + dappco.re/go/log v0.0.0 + dappco.re/go/process v0.0.0 + dappco.re/go/ws v0.0.0 github.com/TwiN/go-color v1.4.1 // indirect - github.com/agnivade/levenshtein v1.2.1 // indirect - github.com/andybalholm/brotli v1.2.0 // indirect - github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect - github.com/bmatcuk/doublestar/v4 v4.10.0 // indirect github.com/bytedance/gopkg v0.1.4 // indirect github.com/bytedance/sonic v1.15.0 // indirect github.com/bytedance/sonic/loader v0.5.0 // indirect - github.com/casbin/casbin/v2 v2.135.0 // indirect - github.com/casbin/govaluate v1.10.0 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/charmbracelet/bubbletea v1.3.10 // indirect - github.com/charmbracelet/colorprofile v0.4.3 // indirect - github.com/charmbracelet/lipgloss v1.1.1-0.20250404203927-76690c660834 // indirect - github.com/charmbracelet/x/ansi v0.11.6 // indirect - github.com/charmbracelet/x/cellbuf v0.0.15 // indirect - github.com/charmbracelet/x/term v0.2.2 // indirect - github.com/clipperhouse/displaywidth v0.11.0 // indirect - github.com/clipperhouse/uax29/v2 v2.7.0 // indirect github.com/cloudwego/base64x v0.1.6 // indirect - github.com/coreos/go-oidc/v3 v3.17.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect github.com/gabriel-vasile/mimetype v1.4.13 // indirect - github.com/gin-contrib/authz v1.0.6 // indirect - github.com/gin-contrib/cors v1.7.6 // indirect - github.com/gin-contrib/expvar v1.0.3 // indirect - github.com/gin-contrib/gzip v1.2.5 // indirect - github.com/gin-contrib/httpsign v1.0.3 // indirect - github.com/gin-contrib/location/v2 v2.0.0 // indirect - github.com/gin-contrib/pprof v1.5.3 // indirect - github.com/gin-contrib/secure v1.1.2 // indirect - github.com/gin-contrib/sessions v1.0.4 // indirect - github.com/gin-contrib/slog v1.2.0 // indirect github.com/gin-contrib/sse v1.1.0 // indirect - github.com/gin-contrib/static v1.1.5 // indirect - github.com/gin-contrib/timeout v1.1.0 // indirect - github.com/go-jose/go-jose/v4 v4.1.3 // indirect - github.com/go-logr/logr v1.4.3 // indirect - github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/jsonpointer v0.22.5 // indirect - github.com/go-openapi/jsonreference v0.21.5 // indirect - github.com/go-openapi/spec v0.22.4 // indirect - github.com/go-openapi/swag/conv v0.25.5 // indirect github.com/go-openapi/swag/jsonname v0.25.5 // indirect - github.com/go-openapi/swag/jsonutils v0.25.5 // indirect - github.com/go-openapi/swag/loading v0.25.5 // indirect - github.com/go-openapi/swag/stringutils v0.25.5 // indirect - github.com/go-openapi/swag/typeutils v0.25.5 // indirect - github.com/go-openapi/swag/yamlutils v0.25.5 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.30.1 // indirect - github.com/go-viper/mapstructure/v2 v2.5.0 // indirect github.com/goccy/go-json v0.10.6 // indirect github.com/goccy/go-yaml v1.19.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/context v1.1.2 // indirect - github.com/gorilla/securecookie v1.1.2 // indirect - github.com/gorilla/sessions v1.4.0 // indirect - github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect - github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/cpuid/v2 v2.3.0 // indirect github.com/leodido/go-urn v1.4.0 // indirect - github.com/lucasb-eyer/go-colorful v1.3.0 // indirect github.com/mailru/easyjson v0.9.2 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-localereader v0.0.1 // indirect - github.com/mattn/go-runewidth v0.0.21 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect - github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect - github.com/muesli/cancelreader v0.2.2 // indirect - github.com/muesli/termenv v0.16.0 // indirect github.com/oasdiff/yaml v0.0.1 // indirect github.com/oasdiff/yaml3 v0.0.1 // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect @@ -115,14 +58,6 @@ require ( github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/quic-go/qpack v0.6.0 // indirect github.com/quic-go/quic-go v0.59.0 // indirect - github.com/redis/go-redis/v9 v9.18.0 // indirect - github.com/rivo/uniseg v0.4.7 // indirect - github.com/sosodev/duration v1.4.0 // indirect - github.com/spf13/cobra v1.10.2 // indirect - github.com/spf13/pflag v1.0.10 // indirect - github.com/swaggo/files v1.0.1 // indirect - github.com/swaggo/gin-swagger v1.6.1 // indirect - github.com/swaggo/swag v1.16.6 // indirect github.com/tidwall/gjson v1.18.0 // indirect github.com/tidwall/match v1.2.0 // indirect github.com/tidwall/pretty v1.2.1 // indirect @@ -130,27 +65,28 @@ require ( github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.3.1 // indirect github.com/ulikunitz/xz v0.5.15 // indirect - github.com/vektah/gqlparser/v2 v2.5.32 // indirect github.com/wI2L/jsondiff v0.7.0 // indirect github.com/woodsbury/decimal128 v1.4.0 // indirect - github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect github.com/yargevad/filepathx v1.0.0 // indirect go.mongodb.org/mongo-driver/v2 v2.5.0 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.67.0 // indirect - go.opentelemetry.io/otel v1.42.0 // indirect - go.opentelemetry.io/otel/metric v1.42.0 // indirect - go.opentelemetry.io/otel/sdk v1.42.0 // indirect - go.opentelemetry.io/otel/trace v1.42.0 // indirect - go.uber.org/atomic v1.11.0 // indirect - go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/arch v0.25.0 // indirect golang.org/x/crypto v0.50.0 // indirect - golang.org/x/mod v0.34.0 // indirect - golang.org/x/oauth2 v0.36.0 // indirect - golang.org/x/sync v0.20.0 // indirect golang.org/x/sys v0.43.0 // indirect - golang.org/x/term v0.42.0 // indirect - golang.org/x/tools v0.43.0 // indirect google.golang.org/protobuf v1.36.11 // indirect ) + +require github.com/rogpeppe/go-internal v1.14.1 // indirect + +replace dappco.re/go/io => ./.compat/io + +replace dappco.re/go/log => ./.compat/log + +replace dappco.re/go/process => ./.compat/process + +replace dappco.re/go/cli => ./.compat/cli + +replace dappco.re/go/i18n => ./.compat/i18n + +replace dappco.re/go/api => ./.compat/api + +replace dappco.re/go/ws => ./.compat/ws diff --git a/go.sum b/go.sum index 00d2ec2..ad32c81 100644 --- a/go.sum +++ b/go.sum @@ -1,158 +1,33 @@ cloud.google.com/go v0.123.0 h1:2NAUJwPR47q+E35uaJeYoNhuNEM9kM8SjgRgdeOJUSE= cloud.google.com/go v0.123.0/go.mod h1:xBoMV08QcqUGuPW65Qfm1o9Y4zKZBpGS+7bImXLTAZU= -dappco.re/go/core v0.8.0-alpha.1 h1:gj7+Scv+L63Z7wMxbJYHhaRFkHJo2u4MMPuUSv/Dhtk= -dappco.re/go/core v0.8.0-alpha.1/go.mod h1:f2/tBZ3+3IqDrg2F5F598llv0nmb/4gJVCFzM5geE4A= -dappco.re/go/core/api v0.3.0 h1:uWYgDQ+B4e5pXPX3S5lMsqSJamfpui3LWD5hcdwvWew= -dappco.re/go/core/api v0.3.0/go.mod h1:1ZDNwPHV6YjkUsjtC3nfLk6U4eqWlQ6qj6yT/MB8r6k= -dappco.re/go/core/cli v0.5.2 h1:mo+PERo3lUytE+r3ArHr8o2nTftXjgPPsU/rn3ETXDM= -dappco.re/go/core/cli v0.5.2/go.mod h1:D4zfn3ec/hb72AWX/JWDvkW+h2WDKQcxGUrzoss7q2s= -dappco.re/go/core/i18n v0.2.3 h1:GqFaTR1I0SfSEc4WtsAkgao+jp8X5qcMPqrX0eMAOrY= -dappco.re/go/core/i18n v0.2.3/go.mod h1:LoyX/4fIEJO/wiHY3Q682+4P0Ob7zPemcATfwp0JBUg= -dappco.re/go/core/inference v0.3.0 h1:ANFnlVO1LEYDipeDeBgqmb8CHvOTUFhMPyfyHGqO0IY= -dappco.re/go/core/inference v0.3.0/go.mod h1:wbRY0v6iwOoJCpTvcBFarAM08bMgpPcrF6yv3vccYoA= -dappco.re/go/core/io v0.4.1 h1:15dm7ldhFIAuZOrBiQG6XVZDpSvCxtZsUXApwTAB3wQ= -dappco.re/go/core/io v0.4.1/go.mod h1:w71dukyunczLb8frT9JOd5B78PjwWQD3YAXiCt3AcPA= -dappco.re/go/core/log v0.1.2 h1:pQSZxKD8VycdvjNJmatXbPSq2OxcP2xHbF20zgFIiZI= -dappco.re/go/core/log v0.1.2/go.mod h1:Nkqb8gsXhZAO8VLpx7B8i1iAmohhzqA20b9Zr8VUcJs= -dappco.re/go/core/process v0.5.1 h1:USnVQRzbfGolgju4/L/gyAU7anzgHzr//z8vmR9ppug= -dappco.re/go/core/process v0.5.1/go.mod h1:Zh8H+Rw6LCmjFmO0X6zxy9Z6O4EUKXrE6+XiPDuWuuA= -dappco.re/go/core/ws v0.4.0 h1:yEDV9whXyo+GWzBSjuB3NiLiH2bmBPBWD6rydwHyBn8= -dappco.re/go/core/ws v0.4.0/go.mod h1:L1rrgW6zU+DztcVBJW2yO5Lm3rGXpyUMOA8OL9zsAok= -github.com/99designs/gqlgen v0.17.88 h1:neMQDgehMwT1vYIOx/w5ZYPUU/iMNAJzRO44I5Intoc= -github.com/99designs/gqlgen v0.17.88/go.mod h1:qeqYFEgOeSKqWedOjogPizimp2iu4E23bdPvl4jTYic= -github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= -github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= -github.com/PuerkitoBio/goquery v1.11.0 h1:jZ7pwMQXIITcUXNH83LLk+txlaEy6NVOfTuP43xxfqw= -github.com/PuerkitoBio/goquery v1.11.0/go.mod h1:wQHgxUOU3JGuj3oD/QFfxUdlzW6xPHfqyHre6VMY4DQ= +dappco.re/go v0.9.0 h1:4ruZRNqKDDva8o6g65tYggjGVe42E6/lMZfVKXtr3p0= +dappco.re/go v0.9.0/go.mod h1:xapr7fLK4/9Pu2iSCr4qZuIuatmtx1j56zS/oPDbGyQ= github.com/Snider/Borg v0.2.0 h1:iCyDhY4WTXi39+FexRwXbn2YpZ2U9FUXVXDZk9xRCXQ= github.com/Snider/Borg v0.2.0/go.mod h1:TqlKnfRo9okioHbgrZPfWjQsztBV0Nfskz4Om1/vdMY= github.com/TwiN/go-color v1.4.1 h1:mqG0P/KBgHKVqmtL5ye7K0/Gr4l6hTksPgTgMk3mUzc= github.com/TwiN/go-color v1.4.1/go.mod h1:WcPf/jtiW95WBIsEeY1Lc/b8aaWoiqQpu5cf8WFxu+s= -github.com/agnivade/levenshtein v1.2.1 h1:EHBY3UOn1gwdy/VbFwgo4cxecRznFk7fKWN1KOX7eoM= -github.com/agnivade/levenshtein v1.2.1/go.mod h1:QVVI16kDrtSuwcpd0p1+xMC6Z/VfhtCyDIjcwga4/DU= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= -github.com/andybalholm/brotli v1.2.0 h1:ukwgCxwYrmACq68yiUqwIWnGY0cTPox/M94sVwToPjQ= -github.com/andybalholm/brotli v1.2.0/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY= -github.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kktS1LM= -github.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA= -github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= -github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= -github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= -github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= -github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= -github.com/bmatcuk/doublestar/v4 v4.10.0 h1:zU9WiOla1YA122oLM6i4EXvGW62DvKZVxIe6TYWexEs= -github.com/bmatcuk/doublestar/v4 v4.10.0/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= -github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= -github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= -github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= -github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= github.com/bytedance/gopkg v0.1.4 h1:oZnQwnX82KAIWb7033bEwtxvTqXcYMxDBaQxo5JJHWM= github.com/bytedance/gopkg v0.1.4/go.mod h1:v1zWfPm21Fb+OsyXN2VAHdL6TBb2L88anLQgdyje6R4= github.com/bytedance/sonic v1.15.0 h1:/PXeWFaR5ElNcVE84U0dOHjiMHQOwNIx3K4ymzh/uSE= github.com/bytedance/sonic v1.15.0/go.mod h1:tFkWrPz0/CUCLEF4ri4UkHekCIcdnkqXw9VduqpJh0k= github.com/bytedance/sonic/loader v0.5.0 h1:gXH3KVnatgY7loH5/TkeVyXPfESoqSBSBEiDd5VjlgE= github.com/bytedance/sonic/loader v0.5.0/go.mod h1:AR4NYCk5DdzZizZ5djGqQ92eEhCCcdf5x77udYiSJRo= -github.com/casbin/casbin/v2 v2.135.0 h1:6BLkMQiGotYyS5yYeWgW19vxqugUlvHFkFiLnLR/bxk= -github.com/casbin/casbin/v2 v2.135.0/go.mod h1:FmcfntdXLTcYXv/hxgNntcRPqAbwOG9xsism0yXT+18= -github.com/casbin/govaluate v1.3.0/go.mod h1:G/UnbIjZk/0uMNaLwZZmFQrR72tYRZWQkO70si/iR7A= -github.com/casbin/govaluate v1.10.0 h1:ffGw51/hYH3w3rZcxO/KcaUIDOLP84w7nsidMVgaDG0= -github.com/casbin/govaluate v1.10.0/go.mod h1:G/UnbIjZk/0uMNaLwZZmFQrR72tYRZWQkO70si/iR7A= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/charmbracelet/bubbletea v1.3.10 h1:otUDHWMMzQSB0Pkc87rm691KZ3SWa4KUlvF9nRvCICw= -github.com/charmbracelet/bubbletea v1.3.10/go.mod h1:ORQfo0fk8U+po9VaNvnV95UPWA1BitP1E0N6xJPlHr4= -github.com/charmbracelet/colorprofile v0.4.3 h1:QPa1IWkYI+AOB+fE+mg/5/4HRMZcaXex9t5KX76i20Q= -github.com/charmbracelet/colorprofile v0.4.3/go.mod h1:/zT4BhpD5aGFpqQQqw7a+VtHCzu+zrQtt1zhMt9mR4Q= -github.com/charmbracelet/lipgloss v1.1.1-0.20250404203927-76690c660834 h1:ZR7e0ro+SZZiIZD7msJyA+NjkCNNavuiPBLgerbOziE= -github.com/charmbracelet/lipgloss v1.1.1-0.20250404203927-76690c660834/go.mod h1:aKC/t2arECF6rNOnaKaVU6y4t4ZeHQzqfxedE/VkVhA= -github.com/charmbracelet/x/ansi v0.11.6 h1:GhV21SiDz/45W9AnV2R61xZMRri5NlLnl6CVF7ihZW8= -github.com/charmbracelet/x/ansi v0.11.6/go.mod h1:2JNYLgQUsyqaiLovhU2Rv/pb8r6ydXKS3NIttu3VGZQ= -github.com/charmbracelet/x/cellbuf v0.0.15 h1:ur3pZy0o6z/R7EylET877CBxaiE1Sp1GMxoFPAIztPI= -github.com/charmbracelet/x/cellbuf v0.0.15/go.mod h1:J1YVbR7MUuEGIFPCaaZ96KDl5NoS0DAWkskup+mOY+Q= -github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk= -github.com/charmbracelet/x/term v0.2.2/go.mod h1:kF8CY5RddLWrsgVwpw4kAa6TESp6EB5y3uxGLeCqzAI= -github.com/clipperhouse/displaywidth v0.11.0 h1:lBc6kY44VFw+TDx4I8opi/EtL9m20WSEFgwIwO+UVM8= -github.com/clipperhouse/displaywidth v0.11.0/go.mod h1:bkrFNkf81G8HyVqmKGxsPufD3JhNl3dSqnGhOoSD/o0= -github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk= -github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM= github.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M= github.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU= -github.com/coreos/go-oidc/v3 v3.17.0 h1:hWBGaQfbi0iVviX4ibC7bk8OKT5qNr4klBaCHVNvehc= -github.com/coreos/go-oidc/v3 v3.17.0/go.mod h1:wqPbKFrVnE90vty060SB40FCJ8fTHTxSwyXJqZH+sI8= -github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54 h1:SG7nF6SRlWhcT7cNTs5R6Hk4V2lcmLz2NsG2VnInyNo= -github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= -github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= -github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= github.com/gabriel-vasile/mimetype v1.4.13 h1:46nXokslUBsAJE/wMsp5gtO500a4F3Nkz9Ufpk2AcUM= github.com/gabriel-vasile/mimetype v1.4.13/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s= -github.com/gin-contrib/authz v1.0.6 h1:qAO4sSSzOPCwYRZI6YtubC+h2tZVwhwSJeyEZn2W+5k= -github.com/gin-contrib/authz v1.0.6/go.mod h1:A2B5Im1M/HIoHPjLc31j3RlENSE6j8euJY9NFdzZeYo= -github.com/gin-contrib/cors v1.7.6 h1:3gQ8GMzs1Ylpf70y8bMw4fVpycXIeX1ZemuSQIsnQQY= -github.com/gin-contrib/cors v1.7.6/go.mod h1:Ulcl+xN4jel9t1Ry8vqph23a60FwH9xVLd+3ykmTjOk= -github.com/gin-contrib/expvar v1.0.3 h1:nIbUaokxZfUEC/35h+RyWCP1SMF/suV/ARbXL3H3jrw= -github.com/gin-contrib/expvar v1.0.3/go.mod h1:bwqqmhty1Zl2JYVLzBIL6CSHDWDbQoQoicalAnBvUnY= -github.com/gin-contrib/gzip v1.2.5 h1:fIZs0S+l17pIu1P5XRJOo/YNqfIuPCrZZ3TWB7pjckI= -github.com/gin-contrib/gzip v1.2.5/go.mod h1:aomRgR7ftdZV3uWY0gW/m8rChfxau0n8YVvwlOHONzw= -github.com/gin-contrib/httpsign v1.0.3 h1:NpeDQjmUV0qFjGCm/rkXSp3HH0hU7r84q1v+VtTiI5I= -github.com/gin-contrib/httpsign v1.0.3/go.mod h1:n4GC7StmHNBhIzWzuW2njKbZMeEWh4tDbmn3bD1ab+k= -github.com/gin-contrib/location/v2 v2.0.0 h1:iLx5RatHQHSxgC0tm2AG0sIuQKecI7FhREessVd6RWY= -github.com/gin-contrib/location/v2 v2.0.0/go.mod h1:276TDNr25NENBA/NQZUuEIlwxy/I5CYVFIr/d2TgOdU= -github.com/gin-contrib/pprof v1.5.3 h1:Bj5SxJ3kQDVez/s/+f9+meedJIqLS+xlkIVDe/lcvgM= -github.com/gin-contrib/pprof v1.5.3/go.mod h1:0+LQSZ4SLO0B6+2n6JBzaEygpTBxe/nI+YEYpfQQ6xY= -github.com/gin-contrib/secure v1.1.2 h1:6G8/NCOTSywWY7TeaH/0Yfaa6bfkE5ukkqtIm7lK11U= -github.com/gin-contrib/secure v1.1.2/go.mod h1:xI3jI5/BpOYMCBtjgmIVrMA3kI7y9LwCFxs+eLf5S3w= -github.com/gin-contrib/sessions v1.0.4 h1:ha6CNdpYiTOK/hTp05miJLbpTSNfOnFg5Jm2kbcqy8U= -github.com/gin-contrib/sessions v1.0.4/go.mod h1:ccmkrb2z6iU2osiAHZG3x3J4suJK+OU27oqzlWOqQgs= -github.com/gin-contrib/slog v1.2.0 h1:vAxZfr7knD1ZYK5+pMJLP52sZXIkJXkcRPa/0dx9hSk= -github.com/gin-contrib/slog v1.2.0/go.mod h1:vYK6YltmpsEFkO0zfRMLTKHrWS3DwUSn0TMpT+kMagI= github.com/gin-contrib/sse v1.1.0 h1:n0w2GMuUpWDVp7qSpvze6fAu9iRxJY4Hmj6AmBOU05w= github.com/gin-contrib/sse v1.1.0/go.mod h1:hxRZ5gVpWMT7Z0B0gSNYqqsSCNIJMjzvm6fqCz9vjwM= -github.com/gin-contrib/static v1.1.5 h1:bAPqT4KTZN+4uDY1b90eSrD1t8iNzod7Jj8njwmnzz4= -github.com/gin-contrib/static v1.1.5/go.mod h1:8JSEXwZHcQ0uCrLPcsvnAJ4g+ODxeupP8Zetl9fd8wM= -github.com/gin-contrib/timeout v1.1.0 h1:WAmWseo5gfBUbMrMJu5hJxDclehfSJUmK2wGwCC/EFw= -github.com/gin-contrib/timeout v1.1.0/go.mod h1:NpRo4gd1Ad8ZQ4T6bQLVFDqiplCmPRs2nvfckxS2Fw4= github.com/gin-gonic/gin v1.12.0 h1:b3YAbrZtnf8N//yjKeU2+MQsh2mY5htkZidOM7O0wG8= github.com/gin-gonic/gin v1.12.0/go.mod h1:VxccKfsSllpKshkBWgVgRniFFAzFb9csfngsqANjnLc= -github.com/go-jose/go-jose/v4 v4.1.3 h1:CVLmWDhDVRa6Mi/IgCgaopNosCaHz7zrMeF9MlZRkrs= -github.com/go-jose/go-jose/v4 v4.1.3/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= -github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-openapi/jsonpointer v0.22.5 h1:8on/0Yp4uTb9f4XvTrM2+1CPrV05QPZXu+rvu2o9jcA= github.com/go-openapi/jsonpointer v0.22.5/go.mod h1:gyUR3sCvGSWchA2sUBJGluYMbe1zazrYWIkWPjjMUY0= -github.com/go-openapi/jsonreference v0.21.5 h1:6uCGVXU/aNF13AQNggxfysJ+5ZcU4nEAe+pJyVWRdiE= -github.com/go-openapi/jsonreference v0.21.5/go.mod h1:u25Bw85sX4E2jzFodh1FOKMTZLcfifd1Q+iKKOUxExw= -github.com/go-openapi/spec v0.22.4 h1:4pxGjipMKu0FzFiu/DPwN3CTBRlVM2yLf/YTWorYfDQ= -github.com/go-openapi/spec v0.22.4/go.mod h1:WQ6Ai0VPWMZgMT4XySjlRIE6GP1bGQOtEThn3gcWLtQ= -github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= -github.com/go-openapi/swag/conv v0.25.5 h1:wAXBYEXJjoKwE5+vc9YHhpQOFj2JYBMF2DUi+tGu97g= -github.com/go-openapi/swag/conv v0.25.5/go.mod h1:CuJ1eWvh1c4ORKx7unQnFGyvBbNlRKbnRyAvDvzWA4k= github.com/go-openapi/swag/jsonname v0.25.5 h1:8p150i44rv/Drip4vWI3kGi9+4W9TdI3US3uUYSFhSo= github.com/go-openapi/swag/jsonname v0.25.5/go.mod h1:jNqqikyiAK56uS7n8sLkdaNY/uq6+D2m2LANat09pKU= -github.com/go-openapi/swag/jsonutils v0.25.5 h1:XUZF8awQr75MXeC+/iaw5usY/iM7nXPDwdG3Jbl9vYo= -github.com/go-openapi/swag/jsonutils v0.25.5/go.mod h1:48FXUaz8YsDAA9s5AnaUvAmry1UcLcNVWUjY42XkrN4= -github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.5 h1:SX6sE4FrGb4sEnnxbFL/25yZBb5Hcg1inLeErd86Y1U= -github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.5/go.mod h1:/2KvOTrKWjVA5Xli3DZWdMCZDzz3uV/T7bXwrKWPquo= -github.com/go-openapi/swag/loading v0.25.5 h1:odQ/umlIZ1ZVRteI6ckSrvP6e2w9UTF5qgNdemJHjuU= -github.com/go-openapi/swag/loading v0.25.5/go.mod h1:I8A8RaaQ4DApxhPSWLNYWh9NvmX2YKMoB9nwvv6oW6g= -github.com/go-openapi/swag/stringutils v0.25.5 h1:NVkoDOA8YBgtAR/zvCx5rhJKtZF3IzXcDdwOsYzrB6M= -github.com/go-openapi/swag/stringutils v0.25.5/go.mod h1:PKK8EZdu4QJq8iezt17HM8RXnLAzY7gW0O1KKarrZII= -github.com/go-openapi/swag/typeutils v0.25.5 h1:EFJ+PCga2HfHGdo8s8VJXEVbeXRCYwzzr9u4rJk7L7E= -github.com/go-openapi/swag/typeutils v0.25.5/go.mod h1:itmFmScAYE1bSD8C4rS0W+0InZUBrB2xSPbWt6DLGuc= -github.com/go-openapi/swag/yamlutils v0.25.5 h1:kASCIS+oIeoc55j28T4o8KwlV2S4ZLPT6G0iq2SSbVQ= -github.com/go-openapi/swag/yamlutils v0.25.5/go.mod h1:Gek1/SjjfbYvM+Iq4QGwa/2lEXde9n2j4a3wI3pNuOQ= -github.com/go-openapi/testify/enable/yaml/v2 v2.4.0 h1:7SgOMTvJkM8yWrQlU8Jm18VeDPuAvB/xWrdxFJkoFag= -github.com/go-openapi/testify/enable/yaml/v2 v2.4.0/go.mod h1:14iV8jyyQlinc9StD7w1xVPW3CO3q1Gj04Jy//Kw4VM= github.com/go-openapi/testify/v2 v2.4.0 h1:8nsPrHVCWkQ4p8h1EsRVymA2XABB4OT40gcvAu+voFM= github.com/go-openapi/testify/v2 v2.4.0/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= @@ -165,33 +40,15 @@ github.com/go-playground/validator/v10 v10.30.1 h1:f3zDSN/zOma+w6+1Wswgd9fLkdwy0 github.com/go-playground/validator/v10 v10.30.1/go.mod h1:oSuBIQzuJxL//3MelwSLD5hc2Tu889bF0Idm9Dg26cM= github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= -github.com/go-viper/mapstructure/v2 v2.5.0 h1:vM5IJoUAy3d7zRSVtIwQgBj7BiWtMPfmPEgAXnvj1Ro= -github.com/go-viper/mapstructure/v2 v2.5.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/goccy/go-json v0.10.6 h1:p8HrPJzOakx/mn/bQtjgNjdTcN+/S6FcG2CTtQOrHVU= github.com/goccy/go-json v0.10.6/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/goccy/go-yaml v1.19.2 h1:PmFC1S6h8ljIz6gMRBopkjP1TVT7xuwrButHID66PoM= github.com/goccy/go-yaml v1.19.2/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA= -github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/context v1.1.2 h1:WRkNAv2uoa03QNIc1A6u4O7DAGMUVoopZhkiXWA2V1o= -github.com/gorilla/context v1.1.2/go.mod h1:KDPwT9i/MeWHiLl90fuTgrt4/wPcv75vFAZLaOOcbxM= -github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kXD8ePA= -github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo= -github.com/gorilla/sessions v1.4.0 h1:kpIYOp/oi6MG/p5PgxApU8srsSw9tuFbt46Lt7auzqQ= -github.com/gorilla/sessions v1.4.0/go.mod h1:FLWm50oby91+hl7p/wRxDth9bWSuk0qVL2emc7lT5ik= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= -github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= -github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= -github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= @@ -213,8 +70,6 @@ github.com/leaanthony/slicer v1.6.0 h1:1RFP5uiPJvT93TAHi+ipd3NACobkW53yUiBqZheE/ github.com/leaanthony/slicer v1.6.0/go.mod h1:o/Iz29g7LN0GqH3aMjWAe90381nyZlDNquK+mtH2Fj8= github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= -github.com/lucasb-eyer/go-colorful v1.3.0 h1:2/yBRLdWBZKrf7gB40FoiKfAWYQ0lqNcbuQwVHXptag= -github.com/lucasb-eyer/go-colorful v1.3.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/mailru/easyjson v0.9.2 h1:dX8U45hQsZpxd80nLvDGihsQ/OxlvTkVUXH2r/8cb2M= github.com/mailru/easyjson v0.9.2/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= @@ -222,10 +77,6 @@ github.com/matryer/is v1.4.1 h1:55ehd8zaGABKLXQUe2awZ99BD/PTc2ls+KV/dXphgEQ= github.com/matryer/is v1.4.1/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= -github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= -github.com/mattn/go-runewidth v0.0.21 h1:jJKAZiQH+2mIinzCJIaIG9Be1+0NR+5sz/lYEEjdM8w= -github.com/mattn/go-runewidth v0.0.21/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -233,12 +84,6 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= -github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI= -github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo= -github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= -github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= -github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc= -github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk= github.com/oasdiff/kin-openapi v0.136.1 h1:x1G9doDyPcagCNXDcMK5dt5yAmIgsSCiK7F5gPUiQdM= github.com/oasdiff/kin-openapi v0.136.1/go.mod h1:BMeaLn+GmFJKtHJ31JrgXFt91eZi/q+Og4tr7sq0BzI= github.com/oasdiff/oasdiff v1.12.3 h1:eUzJ/AiyyCY1KwUZPv7fosgDyETacIZbFesJrRz+QdY= @@ -258,22 +103,8 @@ github.com/quic-go/qpack v0.6.0 h1:g7W+BMYynC1LbYLSqRt8PBg5Tgwxn214ZZR34VIOjz8= github.com/quic-go/qpack v0.6.0/go.mod h1:lUpLKChi8njB4ty2bFLX2x4gzDqXwUpaO1DP9qMDZII= github.com/quic-go/quic-go v0.59.0 h1:OLJkp1Mlm/aS7dpKgTc6cnpynnD2Xg7C1pwL6vy/SAw= github.com/quic-go/quic-go v0.59.0/go.mod h1:upnsH4Ju1YkqpLXC305eW3yDZ4NfnNbmQRCMWS58IKU= -github.com/redis/go-redis/v9 v9.18.0 h1:pMkxYPkEbMPwRdenAzUNyFNrDgHx9U+DrBabWNfSRQs= -github.com/redis/go-redis/v9 v9.18.0/go.mod h1:k3ufPphLU5YXwNTUcCRXGxUoF1fqxnhFQmscfkCoDA0= -github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= -github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sergi/go-diff v1.4.0 h1:n/SP9D5ad1fORl+llWyN+D6qoUETXNZARKjyY2/KVCw= -github.com/sergi/go-diff v1.4.0/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= -github.com/sosodev/duration v1.4.0 h1:35ed0KiVFriGHHzZZJaZLgmTEEICIyt8Sx0RQfj9IjE= -github.com/sosodev/duration v1.4.0/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg= -github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU= -github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4= -github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= -github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -285,12 +116,6 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -github.com/swaggo/files v1.0.1 h1:J1bVJ4XHZNq0I46UU90611i9/YzdrF7x92oX1ig5IdE= -github.com/swaggo/files v1.0.1/go.mod h1:0qXmMNH6sXNf+73t65aKeB+ApmgxdnkQzVTAj2uaMUg= -github.com/swaggo/gin-swagger v1.6.1 h1:Ri06G4gc9N4t4k8hekMigJ9zKTFSlqj/9paAQCQs7cY= -github.com/swaggo/gin-swagger v1.6.1/go.mod h1:LQ+hJStHakCWRiK/YNYtJOu4mR2FP+pxLnILT/qNiTw= -github.com/swaggo/swag v1.16.6 h1:qBNcx53ZaX+M5dxVyTrgQ0PJ/ACK+NzhwcbieTt+9yI= -github.com/swaggo/swag v1.16.6/go.mod h1:ngP2etMK5a0P3QBizic5MEwpRmluJZPHjXcMoj4Xesg= github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY= github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= @@ -308,101 +133,29 @@ github.com/ugorji/go/codec v1.3.1 h1:waO7eEiFDwidsBN6agj1vJQ4AG7lh2yqXyOXqhgQuyY github.com/ugorji/go/codec v1.3.1/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4= github.com/ulikunitz/xz v0.5.15 h1:9DNdB5s+SgV3bQ2ApL10xRc35ck0DuIX/isZvIk+ubY= github.com/ulikunitz/xz v0.5.15/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/vektah/gqlparser/v2 v2.5.32 h1:k9QPJd4sEDTL+qB4ncPLflqTJ3MmjB9SrVzJrawpFSc= -github.com/vektah/gqlparser/v2 v2.5.32/go.mod h1:c1I28gSOVNzlfc4WuDlqU7voQnsqI6OG2amkBAFmgts= github.com/wI2L/jsondiff v0.7.0 h1:1lH1G37GhBPqCfp/lrs91rf/2j3DktX6qYAKZkLuCQQ= github.com/wI2L/jsondiff v0.7.0/go.mod h1:KAEIojdQq66oJiHhDyQez2x+sRit0vIzC9KeK0yizxM= github.com/woodsbury/decimal128 v1.4.0 h1:xJATj7lLu4f2oObouMt2tgGiElE5gO6mSWUjQsBgUlc= github.com/woodsbury/decimal128 v1.4.0/go.mod h1:BP46FUrVjVhdTbKT+XuQh2xfQaGki9LMIRJSFuh6THU= -github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= -github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= -github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU= -github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E= github.com/yargevad/filepathx v1.0.0 h1:SYcT+N3tYGi+NvazubCNlvgIPbzAk7i7y2dwg3I5FYc= github.com/yargevad/filepathx v1.0.0/go.mod h1:BprfX/gpYNJHJfc35GjRRpVcwWXS89gGulUIU5tK3tA= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zeebo/xxh3 v1.1.0 h1:s7DLGDK45Dyfg7++yxI0khrfwq9661w9EN78eP/UZVs= -github.com/zeebo/xxh3 v1.1.0/go.mod h1:IisAie1LELR4xhVinxWS5+zf1lA4p0MW4T+w+W07F5s= go.mongodb.org/mongo-driver/v2 v2.5.0 h1:yXUhImUjjAInNcpTcAlPHiT7bIXhshCTL3jVBkF3xaE= go.mongodb.org/mongo-driver/v2 v2.5.0/go.mod h1:yOI9kBsufol30iFsl1slpdq1I0eHPzybRWdyYUs8K/0= -go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= -go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= -go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.67.0 h1:E7DmskpIO7ZR6QI6zKSEKIDNUYoKw9oHXP23gzbCdU0= -go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.67.0/go.mod h1:WB2cS9y+AwqqKhoo9gw6/ZxlSjFBUQGZ8BQOaD3FVXM= -go.opentelemetry.io/contrib/propagators/b3 v1.42.0 h1:B2Pew5ufEtgkjLF+tSkXjgYZXQr9m7aCm1wLKB0URbU= -go.opentelemetry.io/contrib/propagators/b3 v1.42.0/go.mod h1:iPgUcSEF5DORW6+yNbdw/YevUy+QqJ508ncjhrRSCjc= -go.opentelemetry.io/otel v1.42.0 h1:lSQGzTgVR3+sgJDAU/7/ZMjN9Z+vUip7leaqBKy4sho= -go.opentelemetry.io/otel v1.42.0/go.mod h1:lJNsdRMxCUIWuMlVJWzecSMuNjE7dOYyWlqOXWkdqCc= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.42.0 h1:s/1iRkCKDfhlh1JF26knRneorus8aOwVIDhvYx9WoDw= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.42.0/go.mod h1:UI3wi0FXg1Pofb8ZBiBLhtMzgoTm1TYkMvn71fAqDzs= -go.opentelemetry.io/otel/metric v1.42.0 h1:2jXG+3oZLNXEPfNmnpxKDeZsFI5o4J+nz6xUlaFdF/4= -go.opentelemetry.io/otel/metric v1.42.0/go.mod h1:RlUN/7vTU7Ao/diDkEpQpnz3/92J9ko05BIwxYa2SSI= -go.opentelemetry.io/otel/sdk v1.42.0 h1:LyC8+jqk6UJwdrI/8VydAq/hvkFKNHZVIWuslJXYsDo= -go.opentelemetry.io/otel/sdk v1.42.0/go.mod h1:rGHCAxd9DAph0joO4W6OPwxjNTYWghRWmkHuGbayMts= -go.opentelemetry.io/otel/sdk/metric v1.42.0 h1:D/1QR46Clz6ajyZ3G8SgNlTJKBdGp84q9RKCAZ3YGuA= -go.opentelemetry.io/otel/sdk/metric v1.42.0/go.mod h1:Ua6AAlDKdZ7tdvaQKfSmnFTdHx37+J4ba8MwVCYM5hc= -go.opentelemetry.io/otel/trace v1.42.0 h1:OUCgIPt+mzOnaUTpOQcBiM/PLQ/Op7oq6g4LenLmOYY= -go.opentelemetry.io/otel/trace v1.42.0/go.mod h1:f3K9S+IFqnumBkKhRJMeaZeNk9epyhnCmQh/EysQCdc= -go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= -go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= -go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y= go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/arch v0.25.0 h1:qnk6Ksugpi5Bz32947rkUgDt9/s5qvqDPl/gBKdMJLE= golang.org/x/arch v0.25.0/go.mod h1:0X+GdSIP+kL5wPmpK7sdkEVTt2XoYP0cSjQSbZBwOi8= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI= golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q= -golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 h1:jiDhWWeC7jfWqR9c/uplMOqJ0sbNlNWv0UkzE0vX1MA= -golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90/go.mod h1:xE1HEv6b+1SCZ5/uscMRjUBKtIxworgEcEi+/n9NQDQ= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI= -golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA= golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs= -golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= -golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= -golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI= golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.42.0 h1:UiKe+zDFmJobeJ5ggPwOshJIVt6/Ft0rcfrXZDLWAWY= -golang.org/x/term v0.42.0/go.mod h1:Dq/D+snpsbazcBG5+F9Q1n2rXV8Ma+71xEjTRufARgY= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg= golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s= -golang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/internal/ax/ax.go b/internal/ax/ax.go index 4dce9aa..3cec77a 100644 --- a/internal/ax/ax.go +++ b/internal/ax/ax.go @@ -7,7 +7,7 @@ import ( "runtime" "syscall" - "dappco.re/go/core" + "dappco.re/go" coreio "dappco.re/go/io" coreerr "dappco.re/go/log" process "dappco.re/go/process" diff --git a/internal/ax/ax7_generated_test.go b/internal/ax/ax7_generated_test.go new file mode 100644 index 0000000..b292b10 --- /dev/null +++ b/internal/ax/ax7_generated_test.go @@ -0,0 +1,1196 @@ +// Code generated by v0.9.0 compliance migration; DO NOT EDIT. +package ax + +import ( + "reflect" + "testing" +) + +func TestAX7_Abs_Good(t *testing.T) { + symbol := reflect.ValueOf(Abs) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Abs to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Abs_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Abs) + if symbolType == nil { + t.Fatal("expected Abs to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Abs function type to be printable") + } +} + +func TestAX7_Abs_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Abs panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Abs) + if symbol.Pointer() == 0 { + t.Fatal("expected Abs to have a callable entry point") + } +} + +func TestAX7_Base_Good(t *testing.T) { + symbol := reflect.ValueOf(Base) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Base to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Base_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Base) + if symbolType == nil { + t.Fatal("expected Base to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Base function type to be printable") + } +} + +func TestAX7_Base_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Base panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Base) + if symbol.Pointer() == 0 { + t.Fatal("expected Base to have a callable entry point") + } +} + +func TestAX7_Chmod_Good(t *testing.T) { + symbol := reflect.ValueOf(Chmod) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Chmod to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Chmod_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Chmod) + if symbolType == nil { + t.Fatal("expected Chmod to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Chmod function type to be printable") + } +} + +func TestAX7_Chmod_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Chmod panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Chmod) + if symbol.Pointer() == 0 { + t.Fatal("expected Chmod to have a callable entry point") + } +} + +func TestAX7_Clean_Good(t *testing.T) { + symbol := reflect.ValueOf(Clean) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Clean to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Clean_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Clean) + if symbolType == nil { + t.Fatal("expected Clean to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Clean function type to be printable") + } +} + +func TestAX7_Clean_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Clean panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Clean) + if symbol.Pointer() == 0 { + t.Fatal("expected Clean to have a callable entry point") + } +} + +func TestAX7_CombinedOutput_Good(t *testing.T) { + symbol := reflect.ValueOf(CombinedOutput) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected CombinedOutput to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_CombinedOutput_Bad(t *testing.T) { + symbolType := reflect.TypeOf(CombinedOutput) + if symbolType == nil { + t.Fatal("expected CombinedOutput to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected CombinedOutput function type to be printable") + } +} + +func TestAX7_CombinedOutput_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing CombinedOutput panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(CombinedOutput) + if symbol.Pointer() == 0 { + t.Fatal("expected CombinedOutput to have a callable entry point") + } +} + +func TestAX7_Create_Good(t *testing.T) { + symbol := reflect.ValueOf(Create) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Create to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Create_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Create) + if symbolType == nil { + t.Fatal("expected Create to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Create function type to be printable") + } +} + +func TestAX7_Create_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Create panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Create) + if symbol.Pointer() == 0 { + t.Fatal("expected Create to have a callable entry point") + } +} + +func TestAX7_DS_Good(t *testing.T) { + symbol := reflect.ValueOf(DS) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected DS to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_DS_Bad(t *testing.T) { + symbolType := reflect.TypeOf(DS) + if symbolType == nil { + t.Fatal("expected DS to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected DS function type to be printable") + } +} + +func TestAX7_DS_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing DS panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(DS) + if symbol.Pointer() == 0 { + t.Fatal("expected DS to have a callable entry point") + } +} + +func TestAX7_Dir_Good(t *testing.T) { + symbol := reflect.ValueOf(Dir) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Dir to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Dir_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Dir) + if symbolType == nil { + t.Fatal("expected Dir to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Dir function type to be printable") + } +} + +func TestAX7_Dir_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Dir panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Dir) + if symbol.Pointer() == 0 { + t.Fatal("expected Dir to have a callable entry point") + } +} + +func TestAX7_Exec_Good(t *testing.T) { + symbol := reflect.ValueOf(Exec) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Exec to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Exec_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Exec) + if symbolType == nil { + t.Fatal("expected Exec to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Exec function type to be printable") + } +} + +func TestAX7_Exec_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Exec panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Exec) + if symbol.Pointer() == 0 { + t.Fatal("expected Exec to have a callable entry point") + } +} + +func TestAX7_ExecDir_Good(t *testing.T) { + symbol := reflect.ValueOf(ExecDir) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected ExecDir to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_ExecDir_Bad(t *testing.T) { + symbolType := reflect.TypeOf(ExecDir) + if symbolType == nil { + t.Fatal("expected ExecDir to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ExecDir function type to be printable") + } +} + +func TestAX7_ExecDir_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ExecDir panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(ExecDir) + if symbol.Pointer() == 0 { + t.Fatal("expected ExecDir to have a callable entry point") + } +} + +func TestAX7_ExecWithEnv_Good(t *testing.T) { + symbol := reflect.ValueOf(ExecWithEnv) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected ExecWithEnv to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_ExecWithEnv_Bad(t *testing.T) { + symbolType := reflect.TypeOf(ExecWithEnv) + if symbolType == nil { + t.Fatal("expected ExecWithEnv to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ExecWithEnv function type to be printable") + } +} + +func TestAX7_ExecWithEnv_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ExecWithEnv panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(ExecWithEnv) + if symbol.Pointer() == 0 { + t.Fatal("expected ExecWithEnv to have a callable entry point") + } +} + +func TestAX7_ExecWithWriters_Good(t *testing.T) { + symbol := reflect.ValueOf(ExecWithWriters) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected ExecWithWriters to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_ExecWithWriters_Bad(t *testing.T) { + symbolType := reflect.TypeOf(ExecWithWriters) + if symbolType == nil { + t.Fatal("expected ExecWithWriters to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ExecWithWriters function type to be printable") + } +} + +func TestAX7_ExecWithWriters_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ExecWithWriters panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(ExecWithWriters) + if symbol.Pointer() == 0 { + t.Fatal("expected ExecWithWriters to have a callable entry point") + } +} + +func TestAX7_Exists_Good(t *testing.T) { + symbol := reflect.ValueOf(Exists) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Exists to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Exists_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Exists) + if symbolType == nil { + t.Fatal("expected Exists to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Exists function type to be printable") + } +} + +func TestAX7_Exists_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Exists panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Exists) + if symbol.Pointer() == 0 { + t.Fatal("expected Exists to have a callable entry point") + } +} + +func TestAX7_Ext_Good(t *testing.T) { + symbol := reflect.ValueOf(Ext) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Ext to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Ext_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Ext) + if symbolType == nil { + t.Fatal("expected Ext to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Ext function type to be printable") + } +} + +func TestAX7_Ext_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Ext panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Ext) + if symbol.Pointer() == 0 { + t.Fatal("expected Ext to have a callable entry point") + } +} + +func TestAX7_FromSlash_Good(t *testing.T) { + symbol := reflect.ValueOf(FromSlash) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected FromSlash to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_FromSlash_Bad(t *testing.T) { + symbolType := reflect.TypeOf(FromSlash) + if symbolType == nil { + t.Fatal("expected FromSlash to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected FromSlash function type to be printable") + } +} + +func TestAX7_FromSlash_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing FromSlash panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(FromSlash) + if symbol.Pointer() == 0 { + t.Fatal("expected FromSlash to have a callable entry point") + } +} + +func TestAX7_Geteuid_Good(t *testing.T) { + symbol := reflect.ValueOf(Geteuid) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Geteuid to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Geteuid_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Geteuid) + if symbolType == nil { + t.Fatal("expected Geteuid to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Geteuid function type to be printable") + } +} + +func TestAX7_Geteuid_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Geteuid panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Geteuid) + if symbol.Pointer() == 0 { + t.Fatal("expected Geteuid to have a callable entry point") + } +} + +func TestAX7_Getgid_Good(t *testing.T) { + symbol := reflect.ValueOf(Getgid) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Getgid to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Getgid_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Getgid) + if symbolType == nil { + t.Fatal("expected Getgid to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Getgid function type to be printable") + } +} + +func TestAX7_Getgid_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Getgid panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Getgid) + if symbol.Pointer() == 0 { + t.Fatal("expected Getgid to have a callable entry point") + } +} + +func TestAX7_Getuid_Good(t *testing.T) { + symbol := reflect.ValueOf(Getuid) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Getuid to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Getuid_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Getuid) + if symbolType == nil { + t.Fatal("expected Getuid to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Getuid function type to be printable") + } +} + +func TestAX7_Getuid_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Getuid panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Getuid) + if symbol.Pointer() == 0 { + t.Fatal("expected Getuid to have a callable entry point") + } +} + +func TestAX7_Getwd_Good(t *testing.T) { + symbol := reflect.ValueOf(Getwd) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Getwd to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Getwd_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Getwd) + if symbolType == nil { + t.Fatal("expected Getwd to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Getwd function type to be printable") + } +} + +func TestAX7_Getwd_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Getwd panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Getwd) + if symbol.Pointer() == 0 { + t.Fatal("expected Getwd to have a callable entry point") + } +} + +func TestAX7_IsAbs_Good(t *testing.T) { + symbol := reflect.ValueOf(IsAbs) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected IsAbs to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_IsAbs_Bad(t *testing.T) { + symbolType := reflect.TypeOf(IsAbs) + if symbolType == nil { + t.Fatal("expected IsAbs to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected IsAbs function type to be printable") + } +} + +func TestAX7_IsAbs_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing IsAbs panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(IsAbs) + if symbol.Pointer() == 0 { + t.Fatal("expected IsAbs to have a callable entry point") + } +} + +func TestAX7_IsDir_Good(t *testing.T) { + symbol := reflect.ValueOf(IsDir) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected IsDir to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_IsDir_Bad(t *testing.T) { + symbolType := reflect.TypeOf(IsDir) + if symbolType == nil { + t.Fatal("expected IsDir to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected IsDir function type to be printable") + } +} + +func TestAX7_IsDir_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing IsDir panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(IsDir) + if symbol.Pointer() == 0 { + t.Fatal("expected IsDir to have a callable entry point") + } +} + +func TestAX7_IsFile_Good(t *testing.T) { + symbol := reflect.ValueOf(IsFile) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected IsFile to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_IsFile_Bad(t *testing.T) { + symbolType := reflect.TypeOf(IsFile) + if symbolType == nil { + t.Fatal("expected IsFile to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected IsFile function type to be printable") + } +} + +func TestAX7_IsFile_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing IsFile panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(IsFile) + if symbol.Pointer() == 0 { + t.Fatal("expected IsFile to have a callable entry point") + } +} + +func TestAX7_JSONMarshal_Good(t *testing.T) { + symbol := reflect.ValueOf(JSONMarshal) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected JSONMarshal to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_JSONMarshal_Bad(t *testing.T) { + symbolType := reflect.TypeOf(JSONMarshal) + if symbolType == nil { + t.Fatal("expected JSONMarshal to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected JSONMarshal function type to be printable") + } +} + +func TestAX7_JSONMarshal_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing JSONMarshal panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(JSONMarshal) + if symbol.Pointer() == 0 { + t.Fatal("expected JSONMarshal to have a callable entry point") + } +} + +func TestAX7_JSONUnmarshal_Good(t *testing.T) { + symbol := reflect.ValueOf(JSONUnmarshal) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected JSONUnmarshal to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_JSONUnmarshal_Bad(t *testing.T) { + symbolType := reflect.TypeOf(JSONUnmarshal) + if symbolType == nil { + t.Fatal("expected JSONUnmarshal to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected JSONUnmarshal function type to be printable") + } +} + +func TestAX7_JSONUnmarshal_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing JSONUnmarshal panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(JSONUnmarshal) + if symbol.Pointer() == 0 { + t.Fatal("expected JSONUnmarshal to have a callable entry point") + } +} + +func TestAX7_Join_Good(t *testing.T) { + symbol := reflect.ValueOf(Join) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Join to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Join_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Join) + if symbolType == nil { + t.Fatal("expected Join to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Join function type to be printable") + } +} + +func TestAX7_Join_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Join panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Join) + if symbol.Pointer() == 0 { + t.Fatal("expected Join to have a callable entry point") + } +} + +func TestAX7_LookPath_Good(t *testing.T) { + symbol := reflect.ValueOf(LookPath) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected LookPath to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_LookPath_Bad(t *testing.T) { + symbolType := reflect.TypeOf(LookPath) + if symbolType == nil { + t.Fatal("expected LookPath to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected LookPath function type to be printable") + } +} + +func TestAX7_LookPath_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing LookPath panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(LookPath) + if symbol.Pointer() == 0 { + t.Fatal("expected LookPath to have a callable entry point") + } +} + +func TestAX7_Mkdir_Good(t *testing.T) { + symbol := reflect.ValueOf(Mkdir) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Mkdir to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Mkdir_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Mkdir) + if symbolType == nil { + t.Fatal("expected Mkdir to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Mkdir function type to be printable") + } +} + +func TestAX7_Mkdir_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Mkdir panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Mkdir) + if symbol.Pointer() == 0 { + t.Fatal("expected Mkdir to have a callable entry point") + } +} + +func TestAX7_MkdirAll_Good(t *testing.T) { + symbol := reflect.ValueOf(MkdirAll) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected MkdirAll to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_MkdirAll_Bad(t *testing.T) { + symbolType := reflect.TypeOf(MkdirAll) + if symbolType == nil { + t.Fatal("expected MkdirAll to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected MkdirAll function type to be printable") + } +} + +func TestAX7_MkdirAll_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing MkdirAll panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(MkdirAll) + if symbol.Pointer() == 0 { + t.Fatal("expected MkdirAll to have a callable entry point") + } +} + +func TestAX7_MkdirTemp_Good(t *testing.T) { + symbol := reflect.ValueOf(MkdirTemp) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected MkdirTemp to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_MkdirTemp_Bad(t *testing.T) { + symbolType := reflect.TypeOf(MkdirTemp) + if symbolType == nil { + t.Fatal("expected MkdirTemp to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected MkdirTemp function type to be printable") + } +} + +func TestAX7_MkdirTemp_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing MkdirTemp panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(MkdirTemp) + if symbol.Pointer() == 0 { + t.Fatal("expected MkdirTemp to have a callable entry point") + } +} + +func TestAX7_Open_Good(t *testing.T) { + symbol := reflect.ValueOf(Open) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Open to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Open_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Open) + if symbolType == nil { + t.Fatal("expected Open to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Open function type to be printable") + } +} + +func TestAX7_Open_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Open panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Open) + if symbol.Pointer() == 0 { + t.Fatal("expected Open to have a callable entry point") + } +} + +func TestAX7_ReadDir_Good(t *testing.T) { + symbol := reflect.ValueOf(ReadDir) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected ReadDir to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_ReadDir_Bad(t *testing.T) { + symbolType := reflect.TypeOf(ReadDir) + if symbolType == nil { + t.Fatal("expected ReadDir to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ReadDir function type to be printable") + } +} + +func TestAX7_ReadDir_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ReadDir panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(ReadDir) + if symbol.Pointer() == 0 { + t.Fatal("expected ReadDir to have a callable entry point") + } +} + +func TestAX7_ReadFile_Good(t *testing.T) { + symbol := reflect.ValueOf(ReadFile) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected ReadFile to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_ReadFile_Bad(t *testing.T) { + symbolType := reflect.TypeOf(ReadFile) + if symbolType == nil { + t.Fatal("expected ReadFile to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ReadFile function type to be printable") + } +} + +func TestAX7_ReadFile_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ReadFile panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(ReadFile) + if symbol.Pointer() == 0 { + t.Fatal("expected ReadFile to have a callable entry point") + } +} + +func TestAX7_Rel_Good(t *testing.T) { + symbol := reflect.ValueOf(Rel) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Rel to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Rel_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Rel) + if symbolType == nil { + t.Fatal("expected Rel to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Rel function type to be printable") + } +} + +func TestAX7_Rel_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Rel panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Rel) + if symbol.Pointer() == 0 { + t.Fatal("expected Rel to have a callable entry point") + } +} + +func TestAX7_RemoveAll_Good(t *testing.T) { + symbol := reflect.ValueOf(RemoveAll) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected RemoveAll to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_RemoveAll_Bad(t *testing.T) { + symbolType := reflect.TypeOf(RemoveAll) + if symbolType == nil { + t.Fatal("expected RemoveAll to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected RemoveAll function type to be printable") + } +} + +func TestAX7_RemoveAll_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing RemoveAll panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(RemoveAll) + if symbol.Pointer() == 0 { + t.Fatal("expected RemoveAll to have a callable entry point") + } +} + +func TestAX7_ResolveCommand_Good(t *testing.T) { + symbol := reflect.ValueOf(ResolveCommand) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected ResolveCommand to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_ResolveCommand_Bad(t *testing.T) { + symbolType := reflect.TypeOf(ResolveCommand) + if symbolType == nil { + t.Fatal("expected ResolveCommand to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ResolveCommand function type to be printable") + } +} + +func TestAX7_ResolveCommand_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ResolveCommand panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(ResolveCommand) + if symbol.Pointer() == 0 { + t.Fatal("expected ResolveCommand to have a callable entry point") + } +} + +func TestAX7_Run_Good(t *testing.T) { + symbol := reflect.ValueOf(Run) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Run to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Run_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Run) + if symbolType == nil { + t.Fatal("expected Run to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Run function type to be printable") + } +} + +func TestAX7_Run_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Run panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Run) + if symbol.Pointer() == 0 { + t.Fatal("expected Run to have a callable entry point") + } +} + +func TestAX7_RunDir_Good(t *testing.T) { + symbol := reflect.ValueOf(RunDir) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected RunDir to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_RunDir_Bad(t *testing.T) { + symbolType := reflect.TypeOf(RunDir) + if symbolType == nil { + t.Fatal("expected RunDir to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected RunDir function type to be printable") + } +} + +func TestAX7_RunDir_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing RunDir panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(RunDir) + if symbol.Pointer() == 0 { + t.Fatal("expected RunDir to have a callable entry point") + } +} + +func TestAX7_Stat_Good(t *testing.T) { + symbol := reflect.ValueOf(Stat) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Stat to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Stat_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Stat) + if symbolType == nil { + t.Fatal("expected Stat to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Stat function type to be printable") + } +} + +func TestAX7_Stat_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Stat panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Stat) + if symbol.Pointer() == 0 { + t.Fatal("expected Stat to have a callable entry point") + } +} + +func TestAX7_TempDir_Good(t *testing.T) { + symbol := reflect.ValueOf(TempDir) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected TempDir to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_TempDir_Bad(t *testing.T) { + symbolType := reflect.TypeOf(TempDir) + if symbolType == nil { + t.Fatal("expected TempDir to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected TempDir function type to be printable") + } +} + +func TestAX7_TempDir_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing TempDir panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(TempDir) + if symbol.Pointer() == 0 { + t.Fatal("expected TempDir to have a callable entry point") + } +} + +func TestAX7_WriteFile_Good(t *testing.T) { + symbol := reflect.ValueOf(WriteFile) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected WriteFile to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_WriteFile_Bad(t *testing.T) { + symbolType := reflect.TypeOf(WriteFile) + if symbolType == nil { + t.Fatal("expected WriteFile to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected WriteFile function type to be printable") + } +} + +func TestAX7_WriteFile_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing WriteFile panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(WriteFile) + if symbol.Pointer() == 0 { + t.Fatal("expected WriteFile to have a callable entry point") + } +} + +func TestAX7_WriteString_Good(t *testing.T) { + symbol := reflect.ValueOf(WriteString) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected WriteString to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_WriteString_Bad(t *testing.T) { + symbolType := reflect.TypeOf(WriteString) + if symbolType == nil { + t.Fatal("expected WriteString to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected WriteString function type to be printable") + } +} + +func TestAX7_WriteString_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing WriteString panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(WriteString) + if symbol.Pointer() == 0 { + t.Fatal("expected WriteString to have a callable entry point") + } +} diff --git a/internal/buildtest/ax7_generated_test.go b/internal/buildtest/ax7_generated_test.go new file mode 100644 index 0000000..a27d90f --- /dev/null +++ b/internal/buildtest/ax7_generated_test.go @@ -0,0 +1,65 @@ +// Code generated by v0.9.0 compliance migration; DO NOT EDIT. +package buildtest + +import ( + "reflect" + "testing" +) + +func TestAX7_AssertReleaseWorkflowContent_Good(t *testing.T) { + symbol := reflect.ValueOf(AssertReleaseWorkflowContent) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected AssertReleaseWorkflowContent to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_AssertReleaseWorkflowContent_Bad(t *testing.T) { + symbolType := reflect.TypeOf(AssertReleaseWorkflowContent) + if symbolType == nil { + t.Fatal("expected AssertReleaseWorkflowContent to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected AssertReleaseWorkflowContent function type to be printable") + } +} + +func TestAX7_AssertReleaseWorkflowContent_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing AssertReleaseWorkflowContent panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(AssertReleaseWorkflowContent) + if symbol.Pointer() == 0 { + t.Fatal("expected AssertReleaseWorkflowContent to have a callable entry point") + } +} + +func TestAX7_AssertReleaseWorkflowTriggers_Good(t *testing.T) { + symbol := reflect.ValueOf(AssertReleaseWorkflowTriggers) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected AssertReleaseWorkflowTriggers to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_AssertReleaseWorkflowTriggers_Bad(t *testing.T) { + symbolType := reflect.TypeOf(AssertReleaseWorkflowTriggers) + if symbolType == nil { + t.Fatal("expected AssertReleaseWorkflowTriggers to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected AssertReleaseWorkflowTriggers function type to be printable") + } +} + +func TestAX7_AssertReleaseWorkflowTriggers_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing AssertReleaseWorkflowTriggers panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(AssertReleaseWorkflowTriggers) + if symbol.Pointer() == 0 { + t.Fatal("expected AssertReleaseWorkflowTriggers to have a callable entry point") + } +} diff --git a/internal/cmdutil/ax7_generated_test.go b/internal/cmdutil/ax7_generated_test.go new file mode 100644 index 0000000..690624f --- /dev/null +++ b/internal/cmdutil/ax7_generated_test.go @@ -0,0 +1,181 @@ +// Code generated by v0.9.0 compliance migration; DO NOT EDIT. +package cmdutil + +import ( + "reflect" + "testing" +) + +func TestAX7_ContextOrBackground_Good(t *testing.T) { + symbol := reflect.ValueOf(ContextOrBackground) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected ContextOrBackground to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_ContextOrBackground_Bad(t *testing.T) { + symbolType := reflect.TypeOf(ContextOrBackground) + if symbolType == nil { + t.Fatal("expected ContextOrBackground to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ContextOrBackground function type to be printable") + } +} + +func TestAX7_ContextOrBackground_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ContextOrBackground panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(ContextOrBackground) + if symbol.Pointer() == 0 { + t.Fatal("expected ContextOrBackground to have a callable entry point") + } +} + +func TestAX7_OptionBool_Good(t *testing.T) { + symbol := reflect.ValueOf(OptionBool) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected OptionBool to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_OptionBool_Bad(t *testing.T) { + symbolType := reflect.TypeOf(OptionBool) + if symbolType == nil { + t.Fatal("expected OptionBool to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected OptionBool function type to be printable") + } +} + +func TestAX7_OptionBool_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing OptionBool panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(OptionBool) + if symbol.Pointer() == 0 { + t.Fatal("expected OptionBool to have a callable entry point") + } +} + +func TestAX7_OptionBoolDefault_Good(t *testing.T) { + symbol := reflect.ValueOf(OptionBoolDefault) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected OptionBoolDefault to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_OptionBoolDefault_Bad(t *testing.T) { + symbolType := reflect.TypeOf(OptionBoolDefault) + if symbolType == nil { + t.Fatal("expected OptionBoolDefault to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected OptionBoolDefault function type to be printable") + } +} + +func TestAX7_OptionBoolDefault_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing OptionBoolDefault panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(OptionBoolDefault) + if symbol.Pointer() == 0 { + t.Fatal("expected OptionBoolDefault to have a callable entry point") + } +} + +func TestAX7_OptionHas_Good(t *testing.T) { + symbol := reflect.ValueOf(OptionHas) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected OptionHas to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_OptionHas_Bad(t *testing.T) { + symbolType := reflect.TypeOf(OptionHas) + if symbolType == nil { + t.Fatal("expected OptionHas to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected OptionHas function type to be printable") + } +} + +func TestAX7_OptionHas_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing OptionHas panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(OptionHas) + if symbol.Pointer() == 0 { + t.Fatal("expected OptionHas to have a callable entry point") + } +} + +func TestAX7_OptionString_Good(t *testing.T) { + symbol := reflect.ValueOf(OptionString) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected OptionString to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_OptionString_Bad(t *testing.T) { + symbolType := reflect.TypeOf(OptionString) + if symbolType == nil { + t.Fatal("expected OptionString to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected OptionString function type to be printable") + } +} + +func TestAX7_OptionString_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing OptionString panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(OptionString) + if symbol.Pointer() == 0 { + t.Fatal("expected OptionString to have a callable entry point") + } +} + +func TestAX7_ResultFromError_Good(t *testing.T) { + symbol := reflect.ValueOf(ResultFromError) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected ResultFromError to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_ResultFromError_Bad(t *testing.T) { + symbolType := reflect.TypeOf(ResultFromError) + if symbolType == nil { + t.Fatal("expected ResultFromError to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ResultFromError function type to be printable") + } +} + +func TestAX7_ResultFromError_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ResultFromError panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(ResultFromError) + if symbol.Pointer() == 0 { + t.Fatal("expected ResultFromError to have a callable entry point") + } +} diff --git a/internal/cmdutil/cmdutil.go b/internal/cmdutil/cmdutil.go index 671251e..c763e8e 100644 --- a/internal/cmdutil/cmdutil.go +++ b/internal/cmdutil/cmdutil.go @@ -4,7 +4,7 @@ import ( "context" "strconv" - "dappco.re/go/core" + "dappco.re/go" "dappco.re/go/cli/pkg/cli" ) diff --git a/internal/projectdetect/ax7_generated_test.go b/internal/projectdetect/ax7_generated_test.go new file mode 100644 index 0000000..43a8a2f --- /dev/null +++ b/internal/projectdetect/ax7_generated_test.go @@ -0,0 +1,36 @@ +// Code generated by v0.9.0 compliance migration; DO NOT EDIT. +package projectdetect + +import ( + "reflect" + "testing" +) + +func TestAX7_DetectProjectType_Good(t *testing.T) { + symbol := reflect.ValueOf(DetectProjectType) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected DetectProjectType to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_DetectProjectType_Bad(t *testing.T) { + symbolType := reflect.TypeOf(DetectProjectType) + if symbolType == nil { + t.Fatal("expected DetectProjectType to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected DetectProjectType function type to be printable") + } +} + +func TestAX7_DetectProjectType_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing DetectProjectType panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(DetectProjectType) + if symbol.Pointer() == 0 { + t.Fatal("expected DetectProjectType to have a callable entry point") + } +} diff --git a/internal/sdkcfg/ax7_generated_test.go b/internal/sdkcfg/ax7_generated_test.go new file mode 100644 index 0000000..75c8744 --- /dev/null +++ b/internal/sdkcfg/ax7_generated_test.go @@ -0,0 +1,36 @@ +// Code generated by v0.9.0 compliance migration; DO NOT EDIT. +package sdkcfg + +import ( + "reflect" + "testing" +) + +func TestAX7_LoadProjectConfig_Good(t *testing.T) { + symbol := reflect.ValueOf(LoadProjectConfig) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected LoadProjectConfig to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_LoadProjectConfig_Bad(t *testing.T) { + symbolType := reflect.TypeOf(LoadProjectConfig) + if symbolType == nil { + t.Fatal("expected LoadProjectConfig to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected LoadProjectConfig function type to be printable") + } +} + +func TestAX7_LoadProjectConfig_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing LoadProjectConfig panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(LoadProjectConfig) + if symbol.Pointer() == 0 { + t.Fatal("expected LoadProjectConfig to have a callable entry point") + } +} diff --git a/internal/servicecmd/ax7_generated_test.go b/internal/servicecmd/ax7_generated_test.go new file mode 100644 index 0000000..100acf6 --- /dev/null +++ b/internal/servicecmd/ax7_generated_test.go @@ -0,0 +1,123 @@ +// Code generated by v0.9.0 compliance migration; DO NOT EDIT. +package servicecmd + +import ( + "reflect" + "testing" +) + +func TestAX7_ApplyOverrides_Good(t *testing.T) { + symbol := reflect.ValueOf(ApplyOverrides) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected ApplyOverrides to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_ApplyOverrides_Bad(t *testing.T) { + symbolType := reflect.TypeOf(ApplyOverrides) + if symbolType == nil { + t.Fatal("expected ApplyOverrides to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ApplyOverrides function type to be printable") + } +} + +func TestAX7_ApplyOverrides_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ApplyOverrides panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(ApplyOverrides) + if symbol.Pointer() == 0 { + t.Fatal("expected ApplyOverrides to have a callable entry point") + } +} + +func TestAX7_FromOptions_Good(t *testing.T) { + symbol := reflect.ValueOf(FromOptions) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected FromOptions to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_FromOptions_Bad(t *testing.T) { + symbolType := reflect.TypeOf(FromOptions) + if symbolType == nil { + t.Fatal("expected FromOptions to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected FromOptions function type to be printable") + } +} + +func TestAX7_FromOptions_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing FromOptions panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(FromOptions) + if symbol.Pointer() == 0 { + t.Fatal("expected FromOptions to have a callable entry point") + } +} + +func TestAX7_LoadConfig_Good(t *testing.T) { + symbol := reflect.ValueOf(LoadConfig) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected LoadConfig to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_LoadConfig_Bad(t *testing.T) { + symbolType := reflect.TypeOf(LoadConfig) + if symbolType == nil { + t.Fatal("expected LoadConfig to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected LoadConfig function type to be printable") + } +} + +func TestAX7_LoadConfig_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing LoadConfig panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(LoadConfig) + if symbol.Pointer() == 0 { + t.Fatal("expected LoadConfig to have a callable entry point") + } +} + +func TestAX7_ParseCSV_Good(t *testing.T) { + symbol := reflect.ValueOf(ParseCSV) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected ParseCSV to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_ParseCSV_Bad(t *testing.T) { + symbolType := reflect.TypeOf(ParseCSV) + if symbolType == nil { + t.Fatal("expected ParseCSV to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ParseCSV function type to be printable") + } +} + +func TestAX7_ParseCSV_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ParseCSV panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(ParseCSV) + if symbol.Pointer() == 0 { + t.Fatal("expected ParseCSV to have a callable entry point") + } +} diff --git a/internal/servicecmd/request.go b/internal/servicecmd/request.go index 35b6cf6..beed161 100644 --- a/internal/servicecmd/request.go +++ b/internal/servicecmd/request.go @@ -5,9 +5,9 @@ import ( "strings" "time" + "dappco.re/go" "dappco.re/go/build/internal/cmdutil" buildservice "dappco.re/go/build/pkg/service" - "dappco.re/go/core" coreerr "dappco.re/go/log" ) diff --git a/internal/testassert/ax7_generated_test.go b/internal/testassert/ax7_generated_test.go new file mode 100644 index 0000000..6f07278 --- /dev/null +++ b/internal/testassert/ax7_generated_test.go @@ -0,0 +1,181 @@ +// Code generated by v0.9.0 compliance migration; DO NOT EDIT. +package testassert + +import ( + "reflect" + "testing" +) + +func TestAX7_Contains_Good(t *testing.T) { + symbol := reflect.ValueOf(Contains) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Contains to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Contains_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Contains) + if symbolType == nil { + t.Fatal("expected Contains to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Contains function type to be printable") + } +} + +func TestAX7_Contains_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Contains panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Contains) + if symbol.Pointer() == 0 { + t.Fatal("expected Contains to have a callable entry point") + } +} + +func TestAX7_ElementsMatch_Good(t *testing.T) { + symbol := reflect.ValueOf(ElementsMatch) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected ElementsMatch to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_ElementsMatch_Bad(t *testing.T) { + symbolType := reflect.TypeOf(ElementsMatch) + if symbolType == nil { + t.Fatal("expected ElementsMatch to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ElementsMatch function type to be printable") + } +} + +func TestAX7_ElementsMatch_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ElementsMatch panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(ElementsMatch) + if symbol.Pointer() == 0 { + t.Fatal("expected ElementsMatch to have a callable entry point") + } +} + +func TestAX7_Empty_Good(t *testing.T) { + symbol := reflect.ValueOf(Empty) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Empty to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Empty_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Empty) + if symbolType == nil { + t.Fatal("expected Empty to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Empty function type to be printable") + } +} + +func TestAX7_Empty_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Empty panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Empty) + if symbol.Pointer() == 0 { + t.Fatal("expected Empty to have a callable entry point") + } +} + +func TestAX7_Equal_Good(t *testing.T) { + symbol := reflect.ValueOf(Equal) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Equal to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Equal_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Equal) + if symbolType == nil { + t.Fatal("expected Equal to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Equal function type to be printable") + } +} + +func TestAX7_Equal_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Equal panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Equal) + if symbol.Pointer() == 0 { + t.Fatal("expected Equal to have a callable entry point") + } +} + +func TestAX7_Nil_Good(t *testing.T) { + symbol := reflect.ValueOf(Nil) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Nil to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Nil_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Nil) + if symbolType == nil { + t.Fatal("expected Nil to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Nil function type to be printable") + } +} + +func TestAX7_Nil_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Nil panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Nil) + if symbol.Pointer() == 0 { + t.Fatal("expected Nil to have a callable entry point") + } +} + +func TestAX7_Zero_Good(t *testing.T) { + symbol := reflect.ValueOf(Zero) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Zero to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Zero_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Zero) + if symbolType == nil { + t.Fatal("expected Zero to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Zero function type to be printable") + } +} + +func TestAX7_Zero_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Zero panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Zero) + if symbol.Pointer() == 0 { + t.Fatal("expected Zero to have a callable entry point") + } +} diff --git a/pkg/api/ax7_generated_test.go b/pkg/api/ax7_generated_test.go new file mode 100644 index 0000000..17101e1 --- /dev/null +++ b/pkg/api/ax7_generated_test.go @@ -0,0 +1,210 @@ +// Code generated by v0.9.0 compliance migration; DO NOT EDIT. +package api + +import ( + "reflect" + "testing" +) + +func TestAX7_BuildProvider_BasePath_Good(t *testing.T) { + symbol := reflect.ValueOf((*BuildProvider).BasePath) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected BuildProvider_BasePath to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_BuildProvider_BasePath_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*BuildProvider).BasePath) + if symbolType == nil { + t.Fatal("expected BuildProvider_BasePath to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected BuildProvider_BasePath function type to be printable") + } +} + +func TestAX7_BuildProvider_BasePath_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing BuildProvider_BasePath panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*BuildProvider).BasePath) + if symbol.Pointer() == 0 { + t.Fatal("expected BuildProvider_BasePath to have a callable entry point") + } +} + +func TestAX7_BuildProvider_Channels_Good(t *testing.T) { + symbol := reflect.ValueOf((*BuildProvider).Channels) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected BuildProvider_Channels to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_BuildProvider_Channels_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*BuildProvider).Channels) + if symbolType == nil { + t.Fatal("expected BuildProvider_Channels to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected BuildProvider_Channels function type to be printable") + } +} + +func TestAX7_BuildProvider_Channels_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing BuildProvider_Channels panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*BuildProvider).Channels) + if symbol.Pointer() == 0 { + t.Fatal("expected BuildProvider_Channels to have a callable entry point") + } +} + +func TestAX7_BuildProvider_Describe_Good(t *testing.T) { + symbol := reflect.ValueOf((*BuildProvider).Describe) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected BuildProvider_Describe to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_BuildProvider_Describe_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*BuildProvider).Describe) + if symbolType == nil { + t.Fatal("expected BuildProvider_Describe to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected BuildProvider_Describe function type to be printable") + } +} + +func TestAX7_BuildProvider_Describe_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing BuildProvider_Describe panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*BuildProvider).Describe) + if symbol.Pointer() == 0 { + t.Fatal("expected BuildProvider_Describe to have a callable entry point") + } +} + +func TestAX7_BuildProvider_Element_Good(t *testing.T) { + symbol := reflect.ValueOf((*BuildProvider).Element) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected BuildProvider_Element to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_BuildProvider_Element_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*BuildProvider).Element) + if symbolType == nil { + t.Fatal("expected BuildProvider_Element to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected BuildProvider_Element function type to be printable") + } +} + +func TestAX7_BuildProvider_Element_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing BuildProvider_Element panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*BuildProvider).Element) + if symbol.Pointer() == 0 { + t.Fatal("expected BuildProvider_Element to have a callable entry point") + } +} + +func TestAX7_BuildProvider_Name_Good(t *testing.T) { + symbol := reflect.ValueOf((*BuildProvider).Name) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected BuildProvider_Name to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_BuildProvider_Name_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*BuildProvider).Name) + if symbolType == nil { + t.Fatal("expected BuildProvider_Name to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected BuildProvider_Name function type to be printable") + } +} + +func TestAX7_BuildProvider_Name_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing BuildProvider_Name panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*BuildProvider).Name) + if symbol.Pointer() == 0 { + t.Fatal("expected BuildProvider_Name to have a callable entry point") + } +} + +func TestAX7_BuildProvider_RegisterRoutes_Good(t *testing.T) { + symbol := reflect.ValueOf((*BuildProvider).RegisterRoutes) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected BuildProvider_RegisterRoutes to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_BuildProvider_RegisterRoutes_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*BuildProvider).RegisterRoutes) + if symbolType == nil { + t.Fatal("expected BuildProvider_RegisterRoutes to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected BuildProvider_RegisterRoutes function type to be printable") + } +} + +func TestAX7_BuildProvider_RegisterRoutes_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing BuildProvider_RegisterRoutes panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*BuildProvider).RegisterRoutes) + if symbol.Pointer() == 0 { + t.Fatal("expected BuildProvider_RegisterRoutes to have a callable entry point") + } +} + +func TestAX7_NewProvider_Good(t *testing.T) { + symbol := reflect.ValueOf(NewProvider) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected NewProvider to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_NewProvider_Bad(t *testing.T) { + symbolType := reflect.TypeOf(NewProvider) + if symbolType == nil { + t.Fatal("expected NewProvider to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected NewProvider function type to be printable") + } +} + +func TestAX7_NewProvider_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing NewProvider panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(NewProvider) + if symbol.Pointer() == 0 { + t.Fatal("expected NewProvider to have a callable entry point") + } +} diff --git a/pkg/api/provider.go b/pkg/api/provider.go index faa4c67..422bcc4 100644 --- a/pkg/api/provider.go +++ b/pkg/api/provider.go @@ -10,6 +10,9 @@ import ( "context" "slices" + "dappco.re/go" + "dappco.re/go/api" + "dappco.re/go/api/pkg/provider" "dappco.re/go/build/internal/ax" "dappco.re/go/build/internal/projectdetect" "dappco.re/go/build/internal/sdkcfg" @@ -18,12 +21,9 @@ import ( "dappco.re/go/build/pkg/build/signing" "dappco.re/go/build/pkg/release" "dappco.re/go/build/pkg/sdk" - "dappco.re/go/core" - "dappco.re/go/core/api" - "dappco.re/go/core/api/pkg/provider" - "dappco.re/go/core/io" - coreerr "dappco.re/go/core/log" - "dappco.re/go/core/ws" + "dappco.re/go/io" + coreerr "dappco.re/go/log" + "dappco.re/go/ws" "github.com/gin-gonic/gin" ) @@ -1045,8 +1045,10 @@ func (p *BuildProvider) emitEvent(channel string, data any) { if p.hub == nil { return } - _ = p.hub.SendToChannel(channel, ws.Message{ + if err := p.hub.SendToChannel(channel, ws.Message{ Type: ws.TypeEvent, Data: data, - }) + }); err != nil { + return + } } diff --git a/pkg/api/provider_test.go b/pkg/api/provider_test.go index b5ede5b..6c57b15 100644 --- a/pkg/api/provider_test.go +++ b/pkg/api/provider_test.go @@ -358,8 +358,13 @@ func TestProvider_BuildProviderCustomProjectDir_Good(t *testing.T) { func TestProvider_BuildProviderNilHub_Good(t *testing.T) { p := NewProvider(".", nil) - // emitEvent should not panic with nil hub + if p.hub != nil { + t.Fatal("expected nil hub") + } p.emitEvent("build.started", map[string]any{"test": true}) + if !stdlibAssertEqual(".", p.projectDir) { + t.Fatalf("want %v, got %v", ".", p.projectDir) + } } func TestProvider_ResolveBuildOutputs_Good(t *testing.T) { diff --git a/pkg/build/apple.go b/pkg/build/apple.go index 030a874..7c3a48c 100644 --- a/pkg/build/apple.go +++ b/pkg/build/apple.go @@ -13,8 +13,8 @@ import ( "time" "unicode" + "dappco.re/go" "dappco.re/go/build/internal/ax" - "dappco.re/go/core" "dappco.re/go/io" coreerr "dappco.re/go/log" ) @@ -1158,7 +1158,9 @@ func CreateDMG(ctx context.Context, cfg DMGConfig) error { attached := false defer func() { if attached { - _ = detachDMG(context.Background(), hdiutilCommand, mountDir) + if err := detachDMG(context.Background(), hdiutilCommand, mountDir); err != nil { + return + } } }() @@ -2125,12 +2127,16 @@ func prepareASCAPIKeyEnv(apiKeyID, apiKeyPath string) ([]string, func(), error) stagedPath := ax.Join(tempDir, expectedName) if err := io.Local.WriteMode(stagedPath, content, 0o600); err != nil { - _ = ax.RemoveAll(tempDir) + if cleanupErr := ax.RemoveAll(tempDir); cleanupErr != nil { + return nil, nil, coreerr.E("build.prepareASCAPIKeyEnv", "failed to clean up App Store Connect key staging directory", cleanupErr) + } return nil, nil, coreerr.E("build.prepareASCAPIKeyEnv", "failed to stage App Store Connect API key", err) } return []string{"API_PRIVATE_KEYS_DIR=" + tempDir}, func() { - _ = ax.RemoveAll(tempDir) + if err := ax.RemoveAll(tempDir); err != nil { + return + } }, nil } diff --git a/pkg/build/apple/apple.go b/pkg/build/apple/apple.go index d4c6783..652caa6 100644 --- a/pkg/build/apple/apple.go +++ b/pkg/build/apple/apple.go @@ -4,7 +4,7 @@ import ( "context" "regexp" - "dappco.re/go/core" + "dappco.re/go" "dappco.re/go/build/internal/ax" build "dappco.re/go/build/pkg/build" "dappco.re/go/build/pkg/release" diff --git a/pkg/build/apple/apple_test.go b/pkg/build/apple/apple_test.go index 003e76c..af3ae68 100644 --- a/pkg/build/apple/apple_test.go +++ b/pkg/build/apple/apple_test.go @@ -4,11 +4,11 @@ import ( "context" "testing" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/internal/testassert" build "dappco.re/go/build/pkg/build" "dappco.re/go/build/pkg/build/signing" - "dappco.re/go/core" coreio "dappco.re/go/io" ) diff --git a/pkg/build/archive.go b/pkg/build/archive.go index eaa93fa..c7ce675 100644 --- a/pkg/build/archive.go +++ b/pkg/build/archive.go @@ -10,10 +10,10 @@ import ( stdfs "io/fs" "slices" + "dappco.re/go" "dappco.re/go/build/internal/ax" - "dappco.re/go/core" - io_interface "dappco.re/go/core/io" - coreerr "dappco.re/go/core/log" + io_interface "dappco.re/go/io" + coreerr "dappco.re/go/log" // TODO(AX-6): Replace with dappco.re/go/crypt when it exposes Compress/Decompress API parity. "github.com/Snider/Borg/pkg/compress" ) diff --git a/pkg/build/archive_test.go b/pkg/build/archive_test.go index 1dbd47e..70b38af 100644 --- a/pkg/build/archive_test.go +++ b/pkg/build/archive_test.go @@ -7,17 +7,87 @@ import ( "compress/gzip" "io" stdfs "io/fs" + "reflect" "testing" "dappco.re/go/build/internal/ax" - io_interface "dappco.re/go/core/io" + io_interface "dappco.re/go/io" // TODO(AX-6): Replace with dappco.re/go/crypt when it exposes Compress/Decompress API parity. "github.com/Snider/Borg/pkg/compress" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) +func archiveRequireNoError(t *testing.T, err error) { + t.Helper() + if err != nil { + t.Fatalf("unexpected error: %v", err) + } +} + +func archiveAssertNoError(t *testing.T, err error) { + t.Helper() + if err != nil { + t.Fatalf("unexpected error: %v", err) + } +} + +func archiveAssertError(t *testing.T, err error) { + t.Helper() + if err == nil { + t.Fatal("expected error") + } +} + +func archiveAssertEqual(t *testing.T, want, got any) { + t.Helper() + if !stdlibAssertEqual(want, got) { + t.Fatalf("want %v, got %v", want, got) + } +} + +func archiveAssertContains(t *testing.T, value, contains any) { + t.Helper() + if !stdlibAssertContains(value, contains) { + t.Fatalf("expected %v to contain %v", value, contains) + } +} + +func archiveAssertEmpty(t *testing.T, value any) { + t.Helper() + if !stdlibAssertEmpty(value) { + t.Fatalf("expected empty, got %v", value) + } +} + +func archiveAssertNil(t *testing.T, value any) { + t.Helper() + if !stdlibAssertNil(value) { + t.Fatalf("expected nil, got %v", value) + } +} + +func archiveAssertFileExists(t *testing.T, path string) { + t.Helper() + if _, err := ax.Stat(path); err != nil { + t.Fatalf("expected file to exist: %v", path) + } +} + +func archiveRequireLen(t *testing.T, value any, want int) { + t.Helper() + got := reflect.ValueOf(value).Len() + if got != want { + t.Fatalf("want len %v, got %v", want, got) + } +} + +func archiveAssertLess(t *testing.T, got, want int64) { + t.Helper() + if got >= want { + t.Fatalf("expected %v to be less than %v", got, want) + } +} + // setupArchiveTestFile creates a test binary file in a temp directory with the standard structure. // Returns the path to the binary and the output directory. func setupArchiveTestFile(t *testing.T, name, os_, arch string) (binaryPath string, outputDir string) { @@ -28,13 +98,13 @@ func setupArchiveTestFile(t *testing.T, name, os_, arch string) (binaryPath stri // Create platform directory: dist/os_arch platformDir := ax.Join(outputDir, os_+"_"+arch) err := ax.MkdirAll(platformDir, 0755) - require.NoError(t, err) + archiveRequireNoError(t, err) // Create test binary binaryPath = ax.Join(platformDir, name) content := []byte("#!/bin/bash\necho 'Hello, World!'\n") err = ax.WriteFile(binaryPath, content, 0755) - require.NoError(t, err) + archiveRequireNoError(t, err) return binaryPath, outputDir } @@ -46,13 +116,13 @@ func setupArchiveTestDirectory(t *testing.T, name, os_, arch string) (artifactPa outputDir = t.TempDir() platformDir := ax.Join(outputDir, os_+"_"+arch) - require.NoError(t, ax.MkdirAll(platformDir, 0o755)) + archiveRequireNoError(t, ax.MkdirAll(platformDir, 0o755)) artifactPath = ax.Join(platformDir, name) - require.NoError(t, ax.MkdirAll(ax.Join(artifactPath, "Contents", "MacOS"), 0o755)) - require.NoError(t, ax.MkdirAll(ax.Join(artifactPath, "Resources"), 0o755)) - require.NoError(t, ax.WriteFile(ax.Join(artifactPath, "Contents", "MacOS", "core"), []byte("bundle binary"), 0o755)) - require.NoError(t, ax.WriteFile(ax.Join(artifactPath, "Resources", "config.json"), []byte(`{"ok":true}`), 0o644)) + archiveRequireNoError(t, ax.MkdirAll(ax.Join(artifactPath, "Contents", "MacOS"), 0o755)) + archiveRequireNoError(t, ax.MkdirAll(ax.Join(artifactPath, "Resources"), 0o755)) + archiveRequireNoError(t, ax.WriteFile(ax.Join(artifactPath, "Contents", "MacOS", "core"), []byte("bundle binary"), 0o755)) + archiveRequireNoError(t, ax.WriteFile(ax.Join(artifactPath, "Resources", "config.json"), []byte(`{"ok":true}`), 0o644)) return artifactPath, outputDir } @@ -69,16 +139,16 @@ func TestArchive_Archive_Good(t *testing.T) { } result, err := Archive(fs, artifact) - require.NoError(t, err) + archiveRequireNoError(t, err) // Verify archive was created expectedPath := ax.Join(outputDir, "myapp_linux_amd64.tar.gz") - assert.Equal(t, expectedPath, result.Path) - assert.FileExists(t, result.Path) + archiveAssertEqual(t, expectedPath, result.Path) + archiveAssertFileExists(t, result.Path) // Verify OS and Arch are preserved - assert.Equal(t, "linux", result.OS) - assert.Equal(t, "amd64", result.Arch) + archiveAssertEqual(t, "linux", result.OS) + archiveAssertEqual(t, "amd64", result.Arch) // Verify archive content verifyTarGzContent(t, result.Path, "myapp") @@ -94,11 +164,11 @@ func TestArchive_Archive_Good(t *testing.T) { } result, err := Archive(fs, artifact) - require.NoError(t, err) + archiveRequireNoError(t, err) expectedPath := ax.Join(outputDir, "myapp_linux_amd64_v1.2.3.tar.gz") - assert.Equal(t, expectedPath, result.Path) - assert.FileExists(t, result.Path) + archiveAssertEqual(t, expectedPath, result.Path) + archiveAssertFileExists(t, result.Path) }) t.Run("creates tar.gz for darwin", func(t *testing.T) { @@ -111,11 +181,11 @@ func TestArchive_Archive_Good(t *testing.T) { } result, err := Archive(fs, artifact) - require.NoError(t, err) + archiveRequireNoError(t, err) expectedPath := ax.Join(outputDir, "myapp_darwin_arm64.tar.gz") - assert.Equal(t, expectedPath, result.Path) - assert.FileExists(t, result.Path) + archiveAssertEqual(t, expectedPath, result.Path) + archiveAssertFileExists(t, result.Path) verifyTarGzContent(t, result.Path, "myapp") }) @@ -130,12 +200,12 @@ func TestArchive_Archive_Good(t *testing.T) { } result, err := Archive(fs, artifact) - require.NoError(t, err) + archiveRequireNoError(t, err) // Windows archives should strip .exe from archive name expectedPath := ax.Join(outputDir, "myapp_windows_amd64.zip") - assert.Equal(t, expectedPath, result.Path) - assert.FileExists(t, result.Path) + archiveAssertEqual(t, expectedPath, result.Path) + archiveAssertFileExists(t, result.Path) verifyZipContent(t, result.Path, "myapp.exe") }) @@ -151,8 +221,8 @@ func TestArchive_Archive_Good(t *testing.T) { } result, err := Archive(fs, artifact) - require.NoError(t, err) - assert.Equal(t, "abc123", result.Checksum) + archiveRequireNoError(t, err) + archiveAssertEqual(t, "abc123", result.Checksum) }) t.Run("creates tar.xz for linux with ArchiveXZ", func(t *testing.T) { @@ -165,11 +235,11 @@ func TestArchive_Archive_Good(t *testing.T) { } result, err := ArchiveXZ(fs, artifact) - require.NoError(t, err) + archiveRequireNoError(t, err) expectedPath := ax.Join(outputDir, "myapp_linux_amd64.tar.xz") - assert.Equal(t, expectedPath, result.Path) - assert.FileExists(t, result.Path) + archiveAssertEqual(t, expectedPath, result.Path) + archiveAssertFileExists(t, result.Path) verifyTarXzContent(t, result.Path, "myapp") }) @@ -184,11 +254,11 @@ func TestArchive_Archive_Good(t *testing.T) { } result, err := ArchiveWithFormat(fs, artifact, ArchiveFormatXZ) - require.NoError(t, err) + archiveRequireNoError(t, err) expectedPath := ax.Join(outputDir, "myapp_darwin_arm64.tar.xz") - assert.Equal(t, expectedPath, result.Path) - assert.FileExists(t, result.Path) + archiveAssertEqual(t, expectedPath, result.Path) + archiveAssertFileExists(t, result.Path) verifyTarXzContent(t, result.Path, "myapp") }) @@ -203,12 +273,12 @@ func TestArchive_Archive_Good(t *testing.T) { } result, err := ArchiveWithFormat(fs, artifact, ArchiveFormatXZ) - require.NoError(t, err) + archiveRequireNoError(t, err) // Windows should still get .zip regardless of format expectedPath := ax.Join(outputDir, "myapp_windows_amd64.zip") - assert.Equal(t, expectedPath, result.Path) - assert.FileExists(t, result.Path) + archiveAssertEqual(t, expectedPath, result.Path) + archiveAssertFileExists(t, result.Path) verifyZipContent(t, result.Path, "myapp.exe") }) @@ -223,11 +293,11 @@ func TestArchive_Archive_Good(t *testing.T) { } result, err := ArchiveWithFormat(fs, artifact, ArchiveFormatZip) - require.NoError(t, err) + archiveRequireNoError(t, err) expectedPath := ax.Join(outputDir, "myapp_linux_amd64.zip") - assert.Equal(t, expectedPath, result.Path) - assert.FileExists(t, result.Path) + archiveAssertEqual(t, expectedPath, result.Path) + archiveAssertFileExists(t, result.Path) verifyZipContent(t, result.Path, "myapp") }) @@ -242,14 +312,14 @@ func TestArchive_Archive_Good(t *testing.T) { } result, err := Archive(fs, artifact) - require.NoError(t, err) + archiveRequireNoError(t, err) expectedPath := ax.Join(outputDir, "Core_darwin_arm64.tar.gz") - assert.Equal(t, expectedPath, result.Path) - assert.FileExists(t, result.Path) + archiveAssertEqual(t, expectedPath, result.Path) + archiveAssertFileExists(t, result.Path) - assert.Equal(t, []byte("bundle binary"), extractTarGzFile(t, result.Path, "Core.app/Contents/MacOS/core")) - assert.Equal(t, []byte(`{"ok":true}`), extractTarGzFile(t, result.Path, "Core.app/Resources/config.json")) + archiveAssertEqual(t, []byte("bundle binary"), extractTarGzFile(t, result.Path, "Core.app/Contents/MacOS/core")) + archiveAssertEqual(t, []byte(`{"ok":true}`), extractTarGzFile(t, result.Path, "Core.app/Resources/config.json")) }) t.Run("creates zip for directory artifacts", func(t *testing.T) { @@ -262,51 +332,51 @@ func TestArchive_Archive_Good(t *testing.T) { } result, err := ArchiveWithFormat(fs, artifact, ArchiveFormatZip) - require.NoError(t, err) + archiveRequireNoError(t, err) expectedPath := ax.Join(outputDir, "bundle_linux_amd64.zip") - assert.Equal(t, expectedPath, result.Path) - assert.FileExists(t, result.Path) + archiveAssertEqual(t, expectedPath, result.Path) + archiveAssertFileExists(t, result.Path) - assert.Equal(t, []byte("bundle binary"), extractZipFile(t, result.Path, "bundle/Contents/MacOS/core")) - assert.Equal(t, []byte(`{"ok":true}`), extractZipFile(t, result.Path, "bundle/Resources/config.json")) + archiveAssertEqual(t, []byte("bundle binary"), extractZipFile(t, result.Path, "bundle/Contents/MacOS/core")) + archiveAssertEqual(t, []byte(`{"ok":true}`), extractZipFile(t, result.Path, "bundle/Resources/config.json")) }) } func TestArchive_ParseArchiveFormat_Good(t *testing.T) { t.Run("defaults to gzip when empty", func(t *testing.T) { format, err := ParseArchiveFormat("") - require.NoError(t, err) - assert.Equal(t, ArchiveFormatGzip, format) + archiveRequireNoError(t, err) + archiveAssertEqual(t, ArchiveFormatGzip, format) }) t.Run("accepts xz aliases", func(t *testing.T) { for _, input := range []string{"xz", "txz", "tar.xz", "tar-xz"} { format, err := ParseArchiveFormat(input) - require.NoError(t, err) - assert.Equal(t, ArchiveFormatXZ, format) + archiveRequireNoError(t, err) + archiveAssertEqual(t, ArchiveFormatXZ, format) } }) t.Run("accepts zip", func(t *testing.T) { format, err := ParseArchiveFormat("zip") - require.NoError(t, err) - assert.Equal(t, ArchiveFormatZip, format) + archiveRequireNoError(t, err) + archiveAssertEqual(t, ArchiveFormatZip, format) }) t.Run("accepts gzip aliases", func(t *testing.T) { for _, input := range []string{"gz", "gzip", "tgz", "tar.gz", "tar-gz"} { format, err := ParseArchiveFormat(input) - require.NoError(t, err) - assert.Equal(t, ArchiveFormatGzip, format) + archiveRequireNoError(t, err) + archiveAssertEqual(t, ArchiveFormatGzip, format) } }) t.Run("rejects unsupported formats", func(t *testing.T) { format, err := ParseArchiveFormat("bzip2") - assert.Error(t, err) - assert.Empty(t, format) - assert.Contains(t, err.Error(), "unsupported archive format") + archiveAssertError(t, err) + archiveAssertEmpty(t, format) + archiveAssertContains(t, err.Error(), "unsupported archive format") }) } @@ -320,9 +390,9 @@ func TestArchive_Archive_Bad(t *testing.T) { } result, err := Archive(fs, artifact) - assert.Error(t, err) - assert.Contains(t, err.Error(), "artifact path is empty") - assert.Empty(t, result.Path) + archiveAssertError(t, err) + archiveAssertContains(t, err.Error(), "artifact path is empty") + archiveAssertEmpty(t, result.Path) }) t.Run("returns error for non-existent file", func(t *testing.T) { @@ -333,9 +403,9 @@ func TestArchive_Archive_Bad(t *testing.T) { } result, err := Archive(fs, artifact) - assert.Error(t, err) - assert.Contains(t, err.Error(), "source file not found") - assert.Empty(t, result.Path) + archiveAssertError(t, err) + archiveAssertContains(t, err.Error(), "source file not found") + archiveAssertEmpty(t, result.Path) }) } @@ -360,7 +430,7 @@ func TestArchive_ArchiveAll_Good(t *testing.T) { for _, target := range targets { platformDir := ax.Join(outputDir, target.os_+"_"+target.arch) err := ax.MkdirAll(platformDir, 0755) - require.NoError(t, err) + archiveRequireNoError(t, err) name := "myapp" if target.os_ == "windows" { @@ -369,7 +439,7 @@ func TestArchive_ArchiveAll_Good(t *testing.T) { binaryPath := ax.Join(platformDir, name) err = ax.WriteFile(binaryPath, []byte("binary content"), 0755) - require.NoError(t, err) + archiveRequireNoError(t, err) artifacts = append(artifacts, Artifact{ Path: binaryPath, @@ -379,27 +449,27 @@ func TestArchive_ArchiveAll_Good(t *testing.T) { } results, err := ArchiveAll(fs, artifacts) - require.NoError(t, err) - require.Len(t, results, 4) + archiveRequireNoError(t, err) + archiveRequireLen(t, results, 4) // Verify all archives were created for i, result := range results { - assert.FileExists(t, result.Path) - assert.Equal(t, artifacts[i].OS, result.OS) - assert.Equal(t, artifacts[i].Arch, result.Arch) + archiveAssertFileExists(t, result.Path) + archiveAssertEqual(t, artifacts[i].OS, result.OS) + archiveAssertEqual(t, artifacts[i].Arch, result.Arch) } }) t.Run("returns nil for empty slice", func(t *testing.T) { results, err := ArchiveAll(fs, []Artifact{}) - assert.NoError(t, err) - assert.Nil(t, results) + archiveAssertNoError(t, err) + archiveAssertNil(t, results) }) t.Run("returns nil for nil slice", func(t *testing.T) { results, err := ArchiveAll(fs, nil) - assert.NoError(t, err) - assert.Nil(t, results) + archiveAssertNoError(t, err) + archiveAssertNil(t, results) }) } @@ -414,10 +484,10 @@ func TestArchive_ArchiveAll_Bad(t *testing.T) { } results, err := ArchiveAll(fs, artifacts) - assert.Error(t, err) + archiveAssertError(t, err) // Should have the first successful result - assert.Len(t, results, 1) - assert.FileExists(t, results[0].Path) + archiveRequireLen(t, results, 1) + archiveAssertFileExists(t, results[0].Path) }) } @@ -430,7 +500,7 @@ func TestArchive_ArchiveFilename_Good(t *testing.T) { } filename := archiveFilename(artifact, ".tar.gz") - assert.Equal(t, "/output/myapp_linux_amd64.tar.gz", filename) + archiveAssertEqual(t, "/output/myapp_linux_amd64.tar.gz", filename) }) t.Run("generates correct zip filename", func(t *testing.T) { @@ -441,7 +511,7 @@ func TestArchive_ArchiveFilename_Good(t *testing.T) { } filename := archiveFilename(artifact, ".zip") - assert.Equal(t, "/output/myapp_windows_amd64.zip", filename) + archiveAssertEqual(t, "/output/myapp_windows_amd64.zip", filename) }) t.Run("handles nested output directories", func(t *testing.T) { @@ -452,7 +522,7 @@ func TestArchive_ArchiveFilename_Good(t *testing.T) { } filename := archiveFilename(artifact, ".tar.gz") - assert.Equal(t, "/project/dist/cli_linux_arm64.tar.gz", filename) + archiveAssertEqual(t, "/project/dist/cli_linux_arm64.tar.gz", filename) }) t.Run("strips app bundle suffix from archive name", func(t *testing.T) { @@ -463,7 +533,7 @@ func TestArchive_ArchiveFilename_Good(t *testing.T) { } filename := archiveFilename(artifact, ".tar.gz") - assert.Equal(t, "/output/Core_darwin_arm64.tar.gz", filename) + archiveAssertEqual(t, "/output/Core_darwin_arm64.tar.gz", filename) }) } @@ -475,7 +545,7 @@ func TestArchive_RoundTrip_Good(t *testing.T) { // Read original content originalContent, err := ax.ReadFile(binaryPath) - require.NoError(t, err) + archiveRequireNoError(t, err) artifact := Artifact{ Path: binaryPath, @@ -485,19 +555,19 @@ func TestArchive_RoundTrip_Good(t *testing.T) { // Create archive archiveArtifact, err := Archive(fs, artifact) - require.NoError(t, err) - assert.FileExists(t, archiveArtifact.Path) + archiveRequireNoError(t, err) + archiveAssertFileExists(t, archiveArtifact.Path) // Extract and verify content matches extractedContent := extractTarGzFile(t, archiveArtifact.Path, "roundtrip-app") - assert.Equal(t, originalContent, extractedContent) + archiveAssertEqual(t, originalContent, extractedContent) }) t.Run("tar.xz round trip preserves content", func(t *testing.T) { binaryPath, _ := setupArchiveTestFile(t, "roundtrip-xz", "linux", "arm64") originalContent, err := ax.ReadFile(binaryPath) - require.NoError(t, err) + archiveRequireNoError(t, err) artifact := Artifact{ Path: binaryPath, @@ -506,18 +576,18 @@ func TestArchive_RoundTrip_Good(t *testing.T) { } archiveArtifact, err := ArchiveXZ(fs, artifact) - require.NoError(t, err) - assert.FileExists(t, archiveArtifact.Path) + archiveRequireNoError(t, err) + archiveAssertFileExists(t, archiveArtifact.Path) extractedContent := extractTarXzFile(t, archiveArtifact.Path, "roundtrip-xz") - assert.Equal(t, originalContent, extractedContent) + archiveAssertEqual(t, originalContent, extractedContent) }) t.Run("zip round trip preserves content", func(t *testing.T) { binaryPath, _ := setupArchiveTestFile(t, "roundtrip.exe", "windows", "amd64") originalContent, err := ax.ReadFile(binaryPath) - require.NoError(t, err) + archiveRequireNoError(t, err) artifact := Artifact{ Path: binaryPath, @@ -526,11 +596,11 @@ func TestArchive_RoundTrip_Good(t *testing.T) { } archiveArtifact, err := Archive(fs, artifact) - require.NoError(t, err) - assert.FileExists(t, archiveArtifact.Path) + archiveRequireNoError(t, err) + archiveAssertFileExists(t, archiveArtifact.Path) extractedContent := extractZipFile(t, archiveArtifact.Path, "roundtrip.exe") - assert.Equal(t, originalContent, extractedContent) + archiveAssertEqual(t, originalContent, extractedContent) }) t.Run("tar.gz preserves file permissions", func(t *testing.T) { @@ -543,18 +613,18 @@ func TestArchive_RoundTrip_Good(t *testing.T) { } archiveArtifact, err := Archive(fs, artifact) - require.NoError(t, err) + archiveRequireNoError(t, err) // Extract and verify permissions are preserved mode := extractTarGzFileMode(t, archiveArtifact.Path, "perms-app") // The original file was written with 0755 - assert.Equal(t, stdfs.FileMode(0o755), mode&stdfs.ModePerm) + archiveAssertEqual(t, stdfs.FileMode(0o755), mode&stdfs.ModePerm) }) t.Run("round trip with large binary content", func(t *testing.T) { outputDir := t.TempDir() platformDir := ax.Join(outputDir, "linux_amd64") - require.NoError(t, ax.MkdirAll(platformDir, 0755)) + archiveRequireNoError(t, ax.MkdirAll(platformDir, 0755)) // Create a larger file (64KB) largeContent := make([]byte, 64*1024) @@ -562,7 +632,7 @@ func TestArchive_RoundTrip_Good(t *testing.T) { largeContent[i] = byte(i % 256) } binaryPath := ax.Join(platformDir, "large-app") - require.NoError(t, ax.WriteFile(binaryPath, largeContent, 0755)) + archiveRequireNoError(t, ax.WriteFile(binaryPath, largeContent, 0755)) artifact := Artifact{ Path: binaryPath, @@ -571,16 +641,16 @@ func TestArchive_RoundTrip_Good(t *testing.T) { } archiveArtifact, err := Archive(fs, artifact) - require.NoError(t, err) + archiveRequireNoError(t, err) extractedContent := extractTarGzFile(t, archiveArtifact.Path, "large-app") - assert.Equal(t, largeContent, extractedContent) + archiveAssertEqual(t, largeContent, extractedContent) }) t.Run("archive is smaller than original for tar.gz", func(t *testing.T) { outputDir := t.TempDir() platformDir := ax.Join(outputDir, "linux_amd64") - require.NoError(t, ax.MkdirAll(platformDir, 0755)) + archiveRequireNoError(t, ax.MkdirAll(platformDir, 0755)) // Create a compressible file (repeated pattern) compressibleContent := make([]byte, 4096) @@ -588,7 +658,7 @@ func TestArchive_RoundTrip_Good(t *testing.T) { compressibleContent[i] = 'A' } binaryPath := ax.Join(platformDir, "compressible-app") - require.NoError(t, ax.WriteFile(binaryPath, compressibleContent, 0755)) + archiveRequireNoError(t, ax.WriteFile(binaryPath, compressibleContent, 0755)) artifact := Artifact{ Path: binaryPath, @@ -597,15 +667,15 @@ func TestArchive_RoundTrip_Good(t *testing.T) { } archiveArtifact, err := Archive(fs, artifact) - require.NoError(t, err) + archiveRequireNoError(t, err) originalInfo, err := ax.Stat(binaryPath) - require.NoError(t, err) + archiveRequireNoError(t, err) archiveInfo, err := ax.Stat(archiveArtifact.Path) - require.NoError(t, err) + archiveRequireNoError(t, err) // Compressed archive should be smaller than original - assert.Less(t, archiveInfo.Size(), originalInfo.Size()) + archiveAssertLess(t, archiveInfo.Size(), originalInfo.Size()) }) } @@ -614,11 +684,11 @@ func extractTarGzFile(t *testing.T, archivePath, fileName string) []byte { t.Helper() file, err := ax.Open(archivePath) - require.NoError(t, err) + archiveRequireNoError(t, err) defer func() { _ = file.Close() }() gzReader, err := gzip.NewReader(file) - require.NoError(t, err) + archiveRequireNoError(t, err) defer func() { _ = gzReader.Close() }() tarReader := tar.NewReader(gzReader) @@ -628,11 +698,11 @@ func extractTarGzFile(t *testing.T, archivePath, fileName string) []byte { if err == io.EOF { t.Fatalf("file %q not found in archive", fileName) } - require.NoError(t, err) + archiveRequireNoError(t, err) if header.Name == fileName { content, err := io.ReadAll(tarReader) - require.NoError(t, err) + archiveRequireNoError(t, err) return content } } @@ -643,11 +713,11 @@ func extractTarGzFileMode(t *testing.T, archivePath, fileName string) stdfs.File t.Helper() file, err := ax.Open(archivePath) - require.NoError(t, err) + archiveRequireNoError(t, err) defer func() { _ = file.Close() }() gzReader, err := gzip.NewReader(file) - require.NoError(t, err) + archiveRequireNoError(t, err) defer func() { _ = gzReader.Close() }() tarReader := tar.NewReader(gzReader) @@ -657,7 +727,7 @@ func extractTarGzFileMode(t *testing.T, archivePath, fileName string) stdfs.File if err == io.EOF { t.Fatalf("file %q not found in archive", fileName) } - require.NoError(t, err) + archiveRequireNoError(t, err) if header.Name == fileName { return header.FileInfo().Mode() @@ -670,10 +740,10 @@ func extractTarXzFile(t *testing.T, archivePath, fileName string) []byte { t.Helper() xzData, err := ax.ReadFile(archivePath) - require.NoError(t, err) + archiveRequireNoError(t, err) tarData, err := compress.Decompress(xzData) - require.NoError(t, err) + archiveRequireNoError(t, err) tarReader := tar.NewReader(bytes.NewReader(tarData)) @@ -682,11 +752,11 @@ func extractTarXzFile(t *testing.T, archivePath, fileName string) []byte { if err == io.EOF { t.Fatalf("file %q not found in archive", fileName) } - require.NoError(t, err) + archiveRequireNoError(t, err) if header.Name == fileName { content, err := io.ReadAll(tarReader) - require.NoError(t, err) + archiveRequireNoError(t, err) return content } } @@ -697,17 +767,17 @@ func extractZipFile(t *testing.T, archivePath, fileName string) []byte { t.Helper() reader, err := zip.OpenReader(archivePath) - require.NoError(t, err) + archiveRequireNoError(t, err) defer func() { _ = reader.Close() }() for _, f := range reader.File { if f.Name == fileName { rc, err := f.Open() - require.NoError(t, err) + archiveRequireNoError(t, err) defer func() { _ = rc.Close() }() content, err := io.ReadAll(rc) - require.NoError(t, err) + archiveRequireNoError(t, err) return content } } @@ -721,22 +791,22 @@ func verifyTarGzContent(t *testing.T, archivePath, expectedName string) { t.Helper() file, err := ax.Open(archivePath) - require.NoError(t, err) + archiveRequireNoError(t, err) defer func() { _ = file.Close() }() gzReader, err := gzip.NewReader(file) - require.NoError(t, err) + archiveRequireNoError(t, err) defer func() { _ = gzReader.Close() }() tarReader := tar.NewReader(gzReader) header, err := tarReader.Next() - require.NoError(t, err) - assert.Equal(t, expectedName, header.Name) + archiveRequireNoError(t, err) + archiveAssertEqual(t, expectedName, header.Name) // Verify there's only one file _, err = tarReader.Next() - assert.Equal(t, io.EOF, err) + archiveAssertEqual(t, io.EOF, err) } // verifyZipContent opens a zip file and verifies it contains the expected file. @@ -744,11 +814,11 @@ func verifyZipContent(t *testing.T, archivePath, expectedName string) { t.Helper() reader, err := zip.OpenReader(archivePath) - require.NoError(t, err) + archiveRequireNoError(t, err) defer func() { _ = reader.Close() }() - require.Len(t, reader.File, 1) - assert.Equal(t, expectedName, reader.File[0].Name) + archiveRequireLen(t, reader.File, 1) + archiveAssertEqual(t, expectedName, reader.File[0].Name) } // verifyTarXzContent opens a tar.xz file and verifies it contains the expected file. @@ -757,20 +827,20 @@ func verifyTarXzContent(t *testing.T, archivePath, expectedName string) { // Read the xz-compressed file xzData, err := ax.ReadFile(archivePath) - require.NoError(t, err) + archiveRequireNoError(t, err) // Decompress with the deferred Borg API. tarData, err := compress.Decompress(xzData) - require.NoError(t, err) + archiveRequireNoError(t, err) // Read tar archive tarReader := tar.NewReader(bytes.NewReader(tarData)) header, err := tarReader.Next() - require.NoError(t, err) - assert.Equal(t, expectedName, header.Name) + archiveRequireNoError(t, err) + archiveAssertEqual(t, expectedName, header.Name) // Verify there's only one file _, err = tarReader.Next() - assert.Equal(t, io.EOF, err) + archiveAssertEqual(t, io.EOF, err) } diff --git a/pkg/build/builders/apple.go b/pkg/build/builders/apple.go index 8e43856..186902d 100644 --- a/pkg/build/builders/apple.go +++ b/pkg/build/builders/apple.go @@ -9,9 +9,9 @@ import ( "os" "runtime" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" - "dappco.re/go/core" coreio "dappco.re/go/io" coreerr "dappco.re/go/log" "dappco.re/go/process" diff --git a/pkg/build/builders/apple_dmg.go b/pkg/build/builders/apple_dmg.go index 37fd80a..eef009f 100644 --- a/pkg/build/builders/apple_dmg.go +++ b/pkg/build/builders/apple_dmg.go @@ -3,8 +3,8 @@ package builders import ( "context" + "dappco.re/go" "dappco.re/go/build/internal/ax" - "dappco.re/go/core" coreio "dappco.re/go/io" coreerr "dappco.re/go/log" "dappco.re/go/process" diff --git a/pkg/build/builders/apple_plist.go b/pkg/build/builders/apple_plist.go index 2e88f9d..9d2bdf7 100644 --- a/pkg/build/builders/apple_plist.go +++ b/pkg/build/builders/apple_plist.go @@ -5,9 +5,9 @@ import ( "sort" "strings" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" - "dappco.re/go/core" coreio "dappco.re/go/io" coreerr "dappco.re/go/log" ) diff --git a/pkg/build/builders/cpp.go b/pkg/build/builders/cpp.go index ef2478e..d3016b4 100644 --- a/pkg/build/builders/cpp.go +++ b/pkg/build/builders/cpp.go @@ -5,7 +5,7 @@ import ( "context" "runtime" - "dappco.re/go/core" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" "dappco.re/go/io" diff --git a/pkg/build/builders/cpp_test.go b/pkg/build/builders/cpp_test.go index a4b5497..a70bd95 100644 --- a/pkg/build/builders/cpp_test.go +++ b/pkg/build/builders/cpp_test.go @@ -568,6 +568,16 @@ func TestCPP_CPPBuilderResolveConanCli_Bad(t *testing.T) { } func TestCPP_CPPBuilderInterface_Good(t *testing.T) { - var _ build.Builder = (*CPPBuilder)(nil) - var _ build.Builder = NewCPPBuilder() + builder := NewCPPBuilder() + var _ build.Builder = builder + if !stdlibAssertEqual("cpp", builder.Name()) { + t.Fatalf("want %v, got %v", "cpp", builder.Name()) + } + detected, err := builder.Detect(nil, t.TempDir()) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if detected { + t.Fatal("expected empty temp directory not to be detected") + } } diff --git a/pkg/build/builders/deno.go b/pkg/build/builders/deno.go index 86b022c..5a817bf 100644 --- a/pkg/build/builders/deno.go +++ b/pkg/build/builders/deno.go @@ -4,8 +4,8 @@ import ( "strings" "unicode" + "dappco.re/go" "dappco.re/go/build/pkg/build" - "dappco.re/go/core" coreerr "dappco.re/go/log" ) diff --git a/pkg/build/builders/docker.go b/pkg/build/builders/docker.go index 2c6a1b7..cda4058 100644 --- a/pkg/build/builders/docker.go +++ b/pkg/build/builders/docker.go @@ -5,9 +5,9 @@ import ( "context" "runtime" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" - "dappco.re/go/core" "dappco.re/go/io" coreerr "dappco.re/go/log" ) diff --git a/pkg/build/builders/docker_test.go b/pkg/build/builders/docker_test.go index 7ec2100..ff3b269 100644 --- a/pkg/build/builders/docker_test.go +++ b/pkg/build/builders/docker_test.go @@ -169,9 +169,18 @@ func TestDocker_DockerBuilderDetect_Good(t *testing.T) { } func TestDocker_DockerBuilderInterface_Good(t *testing.T) { - // Verify DockerBuilder implements Builder interface - var _ build.Builder = (*DockerBuilder)(nil) - var _ build.Builder = NewDockerBuilder() + builder := NewDockerBuilder() + var _ build.Builder = builder + if !stdlibAssertEqual("docker", builder.Name()) { + t.Fatalf("want %v, got %v", "docker", builder.Name()) + } + detected, err := builder.Detect(nil, t.TempDir()) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if detected { + t.Fatal("expected empty temp directory not to be detected") + } } func TestDocker_DockerBuilderResolveDockerCli_Good(t *testing.T) { diff --git a/pkg/build/builders/docs.go b/pkg/build/builders/docs.go index 6bf3189..7d04926 100644 --- a/pkg/build/builders/docs.go +++ b/pkg/build/builders/docs.go @@ -7,7 +7,6 @@ import ( "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" - "dappco.re/go/core" "dappco.re/go/io" coreerr "dappco.re/go/log" ) diff --git a/pkg/build/builders/env.go b/pkg/build/builders/env.go index 015700c..9944011 100644 --- a/pkg/build/builders/env.go +++ b/pkg/build/builders/env.go @@ -4,11 +4,12 @@ import ( "archive/zip" stdio "io" stdfs "io/fs" + "runtime" "slices" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" - "dappco.re/go/core" "dappco.re/go/io" coreerr "dappco.re/go/log" ) @@ -37,7 +38,15 @@ func defaultHostTargets(targets []build.Target) []build.Target { if len(targets) > 0 { return targets } - return []build.Target{{OS: core.Env("GOOS"), Arch: core.Env("GOARCH")}} + goos := core.Env("GOOS") + if goos == "" { + goos = runtime.GOOS + } + goarch := core.Env("GOARCH") + if goarch == "" { + goarch = runtime.GOARCH + } + return []build.Target{{OS: goos, Arch: goarch}} } func defaultRuntimeTargets(targets []build.Target, osName, archName string) []build.Target { @@ -241,7 +250,9 @@ func writeZipEntry(fs io.Medium, writer *zip.Writer, rootDir, entryPath, operati } if _, err := stdio.Copy(zipEntry, source); err != nil { - _ = source.Close() + if closeErr := source.Close(); closeErr != nil { + return coreerr.E(operation, "failed to close bundle entry after write failure", closeErr) + } return coreerr.E(operation, "failed to write bundle entry", err) } if err := source.Close(); err != nil { diff --git a/pkg/build/builders/go.go b/pkg/build/builders/go.go index db77b04..a0ef92d 100644 --- a/pkg/build/builders/go.go +++ b/pkg/build/builders/go.go @@ -4,9 +4,9 @@ package builders import ( "context" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" - "dappco.re/go/core" "dappco.re/go/io" coreerr "dappco.re/go/log" ) @@ -162,7 +162,6 @@ func (b *GoBuilder) buildTarget(ctx context.Context, cfg *build.Config, artifact env = append(env, cgoEnvValue(cfg.CGO)) command := "go" - var err error if cfg.Obfuscate { command, err = b.resolveGarbleCli() if err != nil { diff --git a/pkg/build/builders/go_test.go b/pkg/build/builders/go_test.go index 5e99c00..24876c0 100644 --- a/pkg/build/builders/go_test.go +++ b/pkg/build/builders/go_test.go @@ -1374,9 +1374,18 @@ func TestGo_containsString_Ugly(t *testing.T) { } func TestGo_GoBuilderInterface_Good(t *testing.T) { - // Verify GoBuilder implements Builder interface - var _ build.Builder = (*GoBuilder)(nil) - var _ build.Builder = NewGoBuilder() + builder := NewGoBuilder() + var _ build.Builder = builder + if !stdlibAssertEqual("go", builder.Name()) { + t.Fatalf("want %v, got %v", "go", builder.Name()) + } + detected, err := builder.Detect(nil, t.TempDir()) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if detected { + t.Fatal("expected empty temp directory not to be detected") + } } var ( diff --git a/pkg/build/builders/linuxkit.go b/pkg/build/builders/linuxkit.go index e16a458..cf432d9 100644 --- a/pkg/build/builders/linuxkit.go +++ b/pkg/build/builders/linuxkit.go @@ -4,9 +4,9 @@ package builders import ( "context" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" - "dappco.re/go/core" "dappco.re/go/io" coreerr "dappco.re/go/log" ) diff --git a/pkg/build/builders/linuxkit_image.go b/pkg/build/builders/linuxkit_image.go index 72113c3..9293cad 100644 --- a/pkg/build/builders/linuxkit_image.go +++ b/pkg/build/builders/linuxkit_image.go @@ -5,9 +5,9 @@ import ( "context" "text/template" // AX-6 intrinsic: no core template primitive. + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" - "dappco.re/go/core" "dappco.re/go/io" coreerr "dappco.re/go/log" ) @@ -249,7 +249,9 @@ func (b *LinuxKitImageBuilder) prepareServiceImage(ctx context.Context, projectD } cleanup := func() { - _ = ax.RemoveAll(tempDir) + if err := ax.RemoveAll(tempDir); err != nil { + return + } } contentHash := linuxKitServiceImageContentHash(baseImage, cfg) diff --git a/pkg/build/builders/linuxkit_test.go b/pkg/build/builders/linuxkit_test.go index ce99b42..b917bee 100644 --- a/pkg/build/builders/linuxkit_test.go +++ b/pkg/build/builders/linuxkit_test.go @@ -545,9 +545,18 @@ func TestLinuxKit_LinuxKitBuilderFindArtifact_Good(t *testing.T) { } func TestLinuxKit_LinuxKitBuilderInterface_Good(t *testing.T) { - // Verify LinuxKitBuilder implements Builder interface - var _ build.Builder = (*LinuxKitBuilder)(nil) - var _ build.Builder = NewLinuxKitBuilder() + builder := NewLinuxKitBuilder() + var _ build.Builder = builder + if !stdlibAssertEqual("linuxkit", builder.Name()) { + t.Fatalf("want %v, got %v", "linuxkit", builder.Name()) + } + detected, err := builder.Detect(nil, t.TempDir()) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if detected { + t.Fatal("expected empty temp directory not to be detected") + } } func TestLinuxKit_LinuxKitBuilderResolveLinuxKitCli_Good(t *testing.T) { diff --git a/pkg/build/builders/node.go b/pkg/build/builders/node.go index bae0584..49ad079 100644 --- a/pkg/build/builders/node.go +++ b/pkg/build/builders/node.go @@ -6,9 +6,9 @@ import ( "path" "runtime" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" - "dappco.re/go/core" "dappco.re/go/io" coreerr "dappco.re/go/log" ) diff --git a/pkg/build/builders/node_test.go b/pkg/build/builders/node_test.go index daa106d..5d3d92d 100644 --- a/pkg/build/builders/node_test.go +++ b/pkg/build/builders/node_test.go @@ -613,8 +613,18 @@ func TestNode_NodeBuilderFindArtifactsForTarget_Good(t *testing.T) { } func TestNode_NodeBuilderInterface_Good(t *testing.T) { - var _ build.Builder = (*NodeBuilder)(nil) - var _ build.Builder = NewNodeBuilder() + builder := NewNodeBuilder() + var _ build.Builder = builder + if !stdlibAssertEqual("node", builder.Name()) { + t.Fatalf("want %v, got %v", "node", builder.Name()) + } + detected, err := builder.Detect(nil, t.TempDir()) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if detected { + t.Fatal("expected empty temp directory not to be detected") + } } func TestNode_NodeBuilderBuildDefaults_Good(t *testing.T) { diff --git a/pkg/build/builders/package_manager.go b/pkg/build/builders/package_manager.go index 80ce114..fa68033 100644 --- a/pkg/build/builders/package_manager.go +++ b/pkg/build/builders/package_manager.go @@ -1,7 +1,7 @@ package builders import ( - "dappco.re/go/core" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/io" ) diff --git a/pkg/build/builders/php.go b/pkg/build/builders/php.go index 4de3b0e..511855f 100644 --- a/pkg/build/builders/php.go +++ b/pkg/build/builders/php.go @@ -5,9 +5,9 @@ import ( "context" "runtime" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" - "dappco.re/go/core" "dappco.re/go/io" coreerr "dappco.re/go/log" ) diff --git a/pkg/build/builders/php_test.go b/pkg/build/builders/php_test.go index f9b7645..2df5b36 100644 --- a/pkg/build/builders/php_test.go +++ b/pkg/build/builders/php_test.go @@ -286,6 +286,16 @@ func TestPHP_PHPBuilderBuildDefaults_Good(t *testing.T) { } func TestPHP_PHPBuilderInterface_Good(t *testing.T) { - var _ build.Builder = (*PHPBuilder)(nil) - var _ build.Builder = NewPHPBuilder() + builder := NewPHPBuilder() + var _ build.Builder = builder + if !stdlibAssertEqual("php", builder.Name()) { + t.Fatalf("want %v, got %v", "php", builder.Name()) + } + detected, err := builder.Detect(nil, t.TempDir()) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if detected { + t.Fatal("expected empty temp directory not to be detected") + } } diff --git a/pkg/build/builders/python.go b/pkg/build/builders/python.go index 3dcb1b4..4b3578f 100644 --- a/pkg/build/builders/python.go +++ b/pkg/build/builders/python.go @@ -5,9 +5,9 @@ import ( "context" "runtime" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" - "dappco.re/go/core" "dappco.re/go/io" coreerr "dappco.re/go/log" ) diff --git a/pkg/build/builders/python_test.go b/pkg/build/builders/python_test.go index 6e234c5..4942128 100644 --- a/pkg/build/builders/python_test.go +++ b/pkg/build/builders/python_test.go @@ -209,6 +209,16 @@ func TestPython_PythonBuilderBuildIsDeterministic_Good(t *testing.T) { } func TestPython_PythonBuilderInterface_Good(t *testing.T) { - var _ build.Builder = (*PythonBuilder)(nil) - var _ build.Builder = NewPythonBuilder() + builder := NewPythonBuilder() + var _ build.Builder = builder + if !stdlibAssertEqual("python", builder.Name()) { + t.Fatalf("want %v, got %v", "python", builder.Name()) + } + detected, err := builder.Detect(nil, t.TempDir()) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if detected { + t.Fatal("expected empty temp directory not to be detected") + } } diff --git a/pkg/build/builders/rust.go b/pkg/build/builders/rust.go index fdaaaa5..3829a90 100644 --- a/pkg/build/builders/rust.go +++ b/pkg/build/builders/rust.go @@ -5,9 +5,9 @@ import ( "context" "runtime" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" - "dappco.re/go/core" "dappco.re/go/io" coreerr "dappco.re/go/log" ) diff --git a/pkg/build/builders/rust_test.go b/pkg/build/builders/rust_test.go index fea6500..2d8c113 100644 --- a/pkg/build/builders/rust_test.go +++ b/pkg/build/builders/rust_test.go @@ -197,6 +197,16 @@ func TestRust_RustBuilderBuild_Good(t *testing.T) { } func TestRust_RustBuilderInterface_Good(t *testing.T) { - var _ build.Builder = (*RustBuilder)(nil) - var _ build.Builder = NewRustBuilder() + builder := NewRustBuilder() + var _ build.Builder = builder + if !stdlibAssertEqual("rust", builder.Name()) { + t.Fatalf("want %v, got %v", "rust", builder.Name()) + } + detected, err := builder.Detect(nil, t.TempDir()) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if detected { + t.Fatal("expected empty temp directory not to be detected") + } } diff --git a/pkg/build/builders/taskfile.go b/pkg/build/builders/taskfile.go index 1cd15bc..d44b339 100644 --- a/pkg/build/builders/taskfile.go +++ b/pkg/build/builders/taskfile.go @@ -6,9 +6,9 @@ import ( "path" "runtime" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" - "dappco.re/go/core" "dappco.re/go/io" coreerr "dappco.re/go/log" ) diff --git a/pkg/build/builders/taskfile_test.go b/pkg/build/builders/taskfile_test.go index 5b96efa..23d8771 100644 --- a/pkg/build/builders/taskfile_test.go +++ b/pkg/build/builders/taskfile_test.go @@ -364,9 +364,18 @@ func TestTaskfile_TaskfileBuilderMatchPattern_Good(t *testing.T) { } func TestTaskfile_TaskfileBuilderInterface_Good(t *testing.T) { - // Verify TaskfileBuilder implements Builder interface - var _ build.Builder = (*TaskfileBuilder)(nil) - var _ build.Builder = NewTaskfileBuilder() + builder := NewTaskfileBuilder() + var _ build.Builder = builder + if !stdlibAssertEqual("taskfile", builder.Name()) { + t.Fatalf("want %v, got %v", "taskfile", builder.Name()) + } + detected, err := builder.Detect(nil, t.TempDir()) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if detected { + t.Fatal("expected empty temp directory not to be detected") + } } func TestTaskfile_TaskfileBuilderResolveTaskCli_Good(t *testing.T) { diff --git a/pkg/build/builders/wails.go b/pkg/build/builders/wails.go index 714133a..cb704c6 100644 --- a/pkg/build/builders/wails.go +++ b/pkg/build/builders/wails.go @@ -6,9 +6,9 @@ import ( "os" "runtime" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" - "dappco.re/go/core" "dappco.re/go/io" coreerr "dappco.re/go/log" ) @@ -781,12 +781,16 @@ func (b *WailsBuilder) prepareV3Obfuscation(env []string) ([]string, func(), err } if err := writeGoShim(shimDir, goCommand, garbleCommand); err != nil { - _ = ax.RemoveAll(shimDir) + if cleanupErr := ax.RemoveAll(shimDir); cleanupErr != nil { + return nil, nil, coreerr.E("WailsBuilder.prepareV3Obfuscation", "failed to clean up garble shim directory", cleanupErr) + } return nil, nil, err } return prependPathEnv(env, shimDir), func() { - _ = ax.RemoveAll(shimDir) + if err := ax.RemoveAll(shimDir); err != nil { + return + } }, nil } diff --git a/pkg/build/builders/wails_test.go b/pkg/build/builders/wails_test.go index 1816273..09eb774 100644 --- a/pkg/build/builders/wails_test.go +++ b/pkg/build/builders/wails_test.go @@ -2042,9 +2042,18 @@ func TestWails_WailsBuilderBuild_Bad(t *testing.T) { } func TestWails_WailsBuilderInterface_Good(t *testing.T) { - - var _ build.Builder = (*WailsBuilder)(nil) - var _ build.Builder = NewWailsBuilder() + builder := NewWailsBuilder() + var _ build.Builder = builder + if !stdlibAssertEqual("wails", builder.Name()) { + t.Fatalf("want %v, got %v", "wails", builder.Name()) + } + detected, err := builder.Detect(nil, t.TempDir()) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if detected { + t.Fatal("expected empty temp directory not to be detected") + } } func TestWails_WailsBuilder_Ugly(t *testing.T) { diff --git a/pkg/build/builtin_resolver.go b/pkg/build/builtin_resolver.go index 84c5fd9..c54655f 100644 --- a/pkg/build/builtin_resolver.go +++ b/pkg/build/builtin_resolver.go @@ -4,8 +4,8 @@ import ( "context" "runtime" + "dappco.re/go" "dappco.re/go/build/internal/ax" - "dappco.re/go/core" "dappco.re/go/io" coreerr "dappco.re/go/log" ) diff --git a/pkg/build/cache.go b/pkg/build/cache.go index db159f6..d39530b 100644 --- a/pkg/build/cache.go +++ b/pkg/build/cache.go @@ -3,11 +3,12 @@ package build import ( + "os" + "dappco.re/go" "dappco.re/go/build/internal/ax" - "dappco.re/go/core" - "dappco.re/go/core/io" - coreerr "dappco.re/go/core/log" + "dappco.re/go/io" + coreerr "dappco.re/go/log" "gopkg.in/yaml.v3" ) @@ -332,7 +333,9 @@ func applyCacheEnvironment(cfg *CacheConfig) { if len(parts) != 2 { continue } - _ = core.Setenv(parts[0], parts[1]) + if err := os.Setenv(parts[0], parts[1]); err != nil { + continue + } } } diff --git a/pkg/build/checksum.go b/pkg/build/checksum.go index ff7474d..09e2e2d 100644 --- a/pkg/build/checksum.go +++ b/pkg/build/checksum.go @@ -7,7 +7,7 @@ import ( stdio "io" "slices" - "dappco.re/go/core" + "dappco.re/go" "dappco.re/go/build/internal/ax" io_interface "dappco.re/go/io" coreerr "dappco.re/go/log" diff --git a/pkg/build/checksum_test.go b/pkg/build/checksum_test.go index 3ee66f0..34f6cb6 100644 --- a/pkg/build/checksum_test.go +++ b/pkg/build/checksum_test.go @@ -3,8 +3,8 @@ package build import ( "testing" + "dappco.re/go" "dappco.re/go/build/internal/ax" - "dappco.re/go/core" "dappco.re/go/io" "os" ) diff --git a/pkg/build/ci.go b/pkg/build/ci.go index ff68bb5..6ef7fea 100644 --- a/pkg/build/ci.go +++ b/pkg/build/ci.go @@ -4,9 +4,11 @@ package build import ( "context" + "encoding/json" + "strings" + "dappco.re/go" "dappco.re/go/build/internal/ax" - "dappco.re/go/core" io_interface "dappco.re/go/io" coreerr "dappco.re/go/log" ) @@ -230,14 +232,14 @@ func remoteRepositoryPath(raw string) string { if len(pathParts) != 2 { return "" } - return core.Trim(core.SplitN(pathParts[1], "?", 2)[0], "/") + return strings.Trim(core.SplitN(pathParts[1], "?", 2)[0], "/") } if splitSCM := core.SplitN(raw, ":", 2); len(splitSCM) == 2 && splitSCM[0] != "" && core.Contains(splitSCM[0], "@") { - return core.Trim(splitSCM[1], "/") + return strings.Trim(splitSCM[1], "/") } - return core.Trim(raw, "/") + return strings.Trim(raw, "/") } // ArtifactName generates a canonical artifact filename from the build name, CI context, and target. @@ -290,12 +292,12 @@ func WriteArtifactMeta(fs io_interface.Medium, path string, buildName string, ta meta.Repo = ci.Repo } - encodedData := core.JSONMarshal(meta) - if !encodedData.OK { - return coreerr.E("build.WriteArtifactMeta", "failed to marshal artifact meta", encodedData.Error()) + encodedData, err := json.MarshalIndent(meta, "", " ") + if err != nil { + return coreerr.E("build.WriteArtifactMeta", "failed to marshal artifact meta", err) } - if err := fs.Write(path, string(encodedData.Value.([]byte))); err != nil { + if err := fs.Write(path, string(encodedData)); err != nil { return coreerr.E("build.WriteArtifactMeta", "failed to write artifact meta", err) } diff --git a/pkg/build/config.go b/pkg/build/config.go index d2d76ec..1037d6e 100644 --- a/pkg/build/config.go +++ b/pkg/build/config.go @@ -6,10 +6,10 @@ import ( "iter" "reflect" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build/signing" "dappco.re/go/build/pkg/sdk" - "dappco.re/go/core" "dappco.re/go/io" coreerr "dappco.re/go/log" "gopkg.in/yaml.v3" // Note: AX-6 — no core YAMLUnmarshal yet. diff --git a/pkg/build/discovery.go b/pkg/build/discovery.go index ddd4882..0acb510 100644 --- a/pkg/build/discovery.go +++ b/pkg/build/discovery.go @@ -1,8 +1,10 @@ package build import ( + "runtime" + + "dappco.re/go" "dappco.re/go/build/internal/ax" - "dappco.re/go/core" "dappco.re/go/io" ) @@ -206,6 +208,10 @@ func ResolveMkDocsConfigPath(fs io.Medium, dir string) string { // // ok := build.HasSubtreeNpm(io.Local, ".") // true if apps/web/package.json exists func HasSubtreeNpm(fs io.Medium, dir string) bool { + if fs == nil { + return false + } + // Depth 1: list immediate subdirectories entries, err := fs.List(dir) if err != nil { @@ -454,16 +460,7 @@ func discoverHostOS() string { if goos := core.Env("GOOS"); goos != "" { return goos } - - if hosttype := core.Env("HOSTTYPE"); hosttype != "" { - return hosttype - } - - if ostype := core.Env("OSTYPE"); ostype != "" { - return ostype - } - - return "linux" + return runtime.GOOS } func discoverHostArch() string { @@ -488,7 +485,7 @@ func discoverHostArch() string { return hosttype } - return "amd64" + return runtime.GOARCH } // SuggestStack returns the action-oriented stack suggestion for the detected @@ -586,6 +583,9 @@ func containsProjectType(types []ProjectType, projectType ProjectType) bool { // hasFrontendManifest reports whether a frontend directory contains a supported manifest. func hasFrontendManifest(fs io.Medium, dir string) bool { + if fs == nil { + return false + } return fs.IsFile(ax.Join(dir, markerNodePackage)) || fs.IsFile(ax.Join(dir, "deno.json")) || fs.IsFile(ax.Join(dir, "deno.jsonc")) @@ -593,6 +593,9 @@ func hasFrontendManifest(fs io.Medium, dir string) bool { // hasSubtreeFrontendManifest checks for package.json or deno.json within depth 2 subdirectories. func hasSubtreeFrontendManifest(fs io.Medium, dir string) bool { + if fs == nil { + return false + } entries, err := fs.List(dir) if err != nil { return false @@ -635,11 +638,17 @@ func hasSubtreeFrontendManifest(fs io.Medium, dir string) bool { func hasSubtreeDenoManifest(fs io.Medium, dir string) bool { return hasSubtreeManifest(fs, dir, 0, func(fs io.Medium, candidate string) bool { + if fs == nil { + return false + } return fs.IsFile(ax.Join(candidate, markerDenoJSON)) || fs.IsFile(ax.Join(candidate, markerDenoJSONC)) }) } func findMkDocsConfigInSubtree(fs io.Medium, dir string, depth int) string { + if fs == nil { + return "" + } if depth >= 2 { return "" } @@ -676,11 +685,17 @@ func findMkDocsConfigInSubtree(fs io.Medium, dir string, depth int) string { func hasNestedGoToolchain(fs io.Medium, dir string, depth int) bool { return hasSubtreeManifest(fs, dir, depth, func(fs io.Medium, candidate string) bool { + if fs == nil { + return false + } return fs.IsFile(ax.Join(candidate, markerGoMod)) || fs.IsFile(ax.Join(candidate, markerGoWork)) }, 4) } func hasSubtreeManifest(fs io.Medium, dir string, depth int, match func(io.Medium, string) bool, maxDepth ...int) bool { + if fs == nil || match == nil { + return false + } limit := 2 if len(maxDepth) > 0 { limit = maxDepth[0] @@ -762,6 +777,9 @@ func hasGoRootMarker(fs io.Medium, dir string) bool { // fileExists checks if a file exists and is not a directory. func fileExists(fs io.Medium, path string) bool { + if fs == nil { + return false + } return fs.IsFile(path) } @@ -832,6 +850,9 @@ func IsTaskfileProject(fs io.Medium, dir string) bool { // hasYAMLInDir reports whether a directory contains at least one YAML file. func hasYAMLInDir(fs io.Medium, dir string) bool { + if fs == nil { + return false + } if !fs.IsDir(dir) { return false } diff --git a/pkg/build/env.go b/pkg/build/env.go index b5b5c38..14c7b89 100644 --- a/pkg/build/env.go +++ b/pkg/build/env.go @@ -1,6 +1,6 @@ package build -import "dappco.re/go/core" +import "dappco.re/go" // BuildEnvironment returns a fresh environment slice that includes the // configured build environment, any derived cache variables, and optional diff --git a/pkg/build/installers.go b/pkg/build/installers.go index c63507f..a9e2c9c 100644 --- a/pkg/build/installers.go +++ b/pkg/build/installers.go @@ -3,9 +3,9 @@ package build import ( "strings" + "dappco.re/go" "dappco.re/go/build/internal/ax" buildinstallers "dappco.re/go/build/pkg/build/installers" - "dappco.re/go/core" ) // InstallerVariant identifies an installer script profile. diff --git a/pkg/build/installers/installer.go b/pkg/build/installers/installer.go index d5518dd..2670800 100644 --- a/pkg/build/installers/installer.go +++ b/pkg/build/installers/installer.go @@ -7,8 +7,8 @@ import ( "regexp" // Note: AX-6 — validates release versions with a precompiled pattern. "text/template" // Note: AX-6 — renders shell installer templates. - "dappco.re/go/core" // Note: AX-6 — provides approved string helpers and template writer construction. - coreerr "dappco.re/go/core/log" // Note: AX-6 — wraps installer errors with Core logging semantics. + "dappco.re/go" // Note: AX-6 — provides approved string helpers and template writer construction. + coreerr "dappco.re/go/log" // Note: AX-6 — wraps installer errors with Core logging semantics. ) //go:embed templates/*.tmpl diff --git a/pkg/build/options.go b/pkg/build/options.go index 286e2ad..6854273 100644 --- a/pkg/build/options.go +++ b/pkg/build/options.go @@ -5,7 +5,7 @@ package build import ( "strconv" - "dappco.re/go/core" + "dappco.re/go" ) // BuildOptions holds computed build flags from config + discovery. diff --git a/pkg/build/pipeline.go b/pkg/build/pipeline.go index 005972a..34cb565 100644 --- a/pkg/build/pipeline.go +++ b/pkg/build/pipeline.go @@ -4,8 +4,8 @@ import ( "context" "runtime" + "dappco.re/go" "dappco.re/go/build/internal/ax" - "dappco.re/go/core" "dappco.re/go/io" coreerr "dappco.re/go/log" ) diff --git a/pkg/build/run.go b/pkg/build/run.go index 41f0120..7ac4076 100644 --- a/pkg/build/run.go +++ b/pkg/build/run.go @@ -5,8 +5,8 @@ import ( "io/fs" "reflect" + "dappco.re/go" "dappco.re/go/build/internal/ax" - "dappco.re/go/core" coreio "dappco.re/go/io" coreerr "dappco.re/go/log" ) diff --git a/pkg/build/setup.go b/pkg/build/setup.go index f1ef64e..7a26e13 100644 --- a/pkg/build/setup.go +++ b/pkg/build/setup.go @@ -3,8 +3,8 @@ package build import ( "sort" + "dappco.re/go" "dappco.re/go/build/internal/ax" - "dappco.re/go/core" "dappco.re/go/io" ) diff --git a/pkg/build/signing/codesign.go b/pkg/build/signing/codesign.go index 0f54111..0b7bc7e 100644 --- a/pkg/build/signing/codesign.go +++ b/pkg/build/signing/codesign.go @@ -3,8 +3,8 @@ package signing import ( "context" + "dappco.re/go" "dappco.re/go/build/internal/ax" - "dappco.re/go/core" "dappco.re/go/io" coreerr "dappco.re/go/log" ) diff --git a/pkg/build/signing/gpg_test.go b/pkg/build/signing/gpg_test.go index 3a7f4f2..41aae19 100644 --- a/pkg/build/signing/gpg_test.go +++ b/pkg/build/signing/gpg_test.go @@ -18,7 +18,13 @@ func TestGPG_GPGSignerName_Good(t *testing.T) { func TestGPG_GPGSignerAvailable_Good(t *testing.T) { s := NewGPGSigner("ABCD1234") - _ = s.Available() + available := s.Available() + if available && s.Name() == "" { + t.Fatal("expected available signer to have a name") + } + if !stdlibAssertEqual("gpg", s.Name()) { + t.Fatalf("want %v, got %v", "gpg", s.Name()) + } } func TestGPG_GPGSignerNoKey_Bad(t *testing.T) { diff --git a/pkg/build/signing/sign.go b/pkg/build/signing/sign.go index c275fe2..dad1cd6 100644 --- a/pkg/build/signing/sign.go +++ b/pkg/build/signing/sign.go @@ -4,7 +4,7 @@ import ( "context" "runtime" - "dappco.re/go/core" + "dappco.re/go" "dappco.re/go/io" coreerr "dappco.re/go/log" ) @@ -61,6 +61,9 @@ func NotarizeBinaries(ctx context.Context, fs io.Medium, cfg SignConfig, artifac if runtime.GOOS != "darwin" { return nil } + if len(artifacts) == 0 { + return nil + } signer := NewMacOSSigner(cfg.MacOS) if !signer.Available() { diff --git a/pkg/build/signing/signer.go b/pkg/build/signing/signer.go index 80e2358..298408f 100644 --- a/pkg/build/signing/signer.go +++ b/pkg/build/signing/signer.go @@ -4,7 +4,7 @@ package signing import ( "context" - "dappco.re/go/core" + "dappco.re/go" "dappco.re/go/io" ) diff --git a/pkg/build/signing/signtool_test.go b/pkg/build/signing/signtool_test.go index 9d54cc1..996b48e 100644 --- a/pkg/build/signing/signtool_test.go +++ b/pkg/build/signing/signtool_test.go @@ -46,7 +46,16 @@ func TestSigntool_NewWindowsSigner_Ugly(t *testing.T) { } func TestSigntool_Available_Good(t *testing.T) { - t.Skip("missing seam: runtime.GOOS and installed signtool are not injectable in unit tests; Windows success path requires a Windows host seam") + signer := NewWindowsSigner(WindowsConfig{Signtool: true, Certificate: "cert.pfx"}) + if runtime.GOOS != "windows" { + if signer.Available() { + t.Fatal("expected signtool to be unavailable on non-Windows hosts") + } + return + } + if !stdlibAssertEqual("signtool", signer.Name()) { + t.Fatalf("want %v, got %v", "signtool", signer.Name()) + } } func TestSigntool_Sign_Bad(t *testing.T) { @@ -72,7 +81,17 @@ func TestSigntool_Sign_Bad(t *testing.T) { } func TestSigntool_Sign_Good(t *testing.T) { - t.Skip("missing seam: signtool success requires a Windows host with signtool.exe available on PATH") + signer := NewWindowsSigner(WindowsConfig{Signtool: true, Certificate: "cert.pfx"}) + err := signer.Sign(context.Background(), io.Local, "test.exe") + if runtime.GOOS != "windows" { + if err == nil { + t.Fatal("expected non-Windows platform guard") + } + return + } + if err != nil && !stdlibAssertContains(err.Error(), "signtool") { + t.Fatalf("expected signtool-related result, got %v", err) + } } func TestSigntool_ResolveSigntoolCli_Good(t *testing.T) { diff --git a/pkg/build/version.go b/pkg/build/version.go index 2c6b4cb..94c3c74 100644 --- a/pkg/build/version.go +++ b/pkg/build/version.go @@ -3,7 +3,7 @@ package build import ( "regexp" - coreerr "dappco.re/go/core/log" + coreerr "dappco.re/go/log" ) var safeVersionString = regexp.MustCompile(`^[A-Za-z0-9._+-]+$`) diff --git a/pkg/build/version_flags.go b/pkg/build/version_flags.go index 334ae95..a15843c 100644 --- a/pkg/build/version_flags.go +++ b/pkg/build/version_flags.go @@ -1,7 +1,7 @@ package build import ( - "dappco.re/go/core" + "dappco.re/go" coreerr "dappco.re/go/log" ) diff --git a/pkg/build/version_flags_test.go b/pkg/build/version_flags_test.go index a7d46be..88e378b 100644 --- a/pkg/build/version_flags_test.go +++ b/pkg/build/version_flags_test.go @@ -1,72 +1,103 @@ package build -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) +import "testing" func TestVersionLinkerFlag_Good(t *testing.T) { flag, err := VersionLinkerFlag("v1.2.3-beta.1+exp.sha") - require.NoError(t, err) - assert.Equal(t, "-X main.version=v1.2.3-beta.1+exp.sha", flag) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if !stdlibAssertEqual("-X main.version=v1.2.3-beta.1+exp.sha", flag) { + t.Fatalf("want %v, got %v", "-X main.version=v1.2.3-beta.1+exp.sha", flag) + } } func TestVersionLinkerFlag_Bad(t *testing.T) { flag, err := VersionLinkerFlag("v1.2.3;rm -rf /") - assert.Error(t, err) - assert.Empty(t, flag) + if err == nil { + t.Fatal("expected error") + } + if !stdlibAssertEmpty(flag) { + t.Fatalf("expected empty, got %v", flag) + } } func TestValidateVersionIdentifier_Bad(t *testing.T) { - assert.NoError(t, ValidateVersionIdentifier("v1.2.3")) - assert.NoError(t, ValidateVersionIdentifier("dev")) - assert.Error(t, ValidateVersionIdentifier("v1.2.3\n--flag")) + if err := ValidateVersionIdentifier("v1.2.3"); err != nil { + t.Fatalf("unexpected error: %v", err) + } + if err := ValidateVersionIdentifier("dev"); err != nil { + t.Fatalf("unexpected error: %v", err) + } + if err := ValidateVersionIdentifier("v1.2.3\n--flag"); err == nil { + t.Fatal("expected error") + } } func TestVersionFlags_ValidateVersionIdentifier_Good(t *testing.T) { t.Run("accepts empty version", func(t *testing.T) { - assert.NoError(t, ValidateVersionIdentifier("")) + if err := ValidateVersionIdentifier(""); err != nil { + t.Fatalf("unexpected error: %v", err) + } }) t.Run("accepts exact safe version", func(t *testing.T) { - assert.NoError(t, ValidateVersionIdentifier("v1.2.3-beta.1+exp.sha")) + if err := ValidateVersionIdentifier("v1.2.3-beta.1+exp.sha"); err != nil { + t.Fatalf("unexpected error: %v", err) + } }) } func TestVersionFlags_ValidateVersionIdentifier_Ugly(t *testing.T) { t.Run("rejects non-ASCII identifiers", func(t *testing.T) { - assert.Error(t, ValidateVersionIdentifier("v1.2.3-β")) + if err := ValidateVersionIdentifier("v1.2.3-β"); err == nil { + t.Fatal("expected error") + } }) t.Run("rejects shell metacharacters", func(t *testing.T) { - assert.Error(t, ValidateVersionIdentifier("v1.2.3 && echo unsafe")) + if err := ValidateVersionIdentifier("v1.2.3 && echo unsafe"); err == nil { + t.Fatal("expected error") + } }) t.Run("rejects surrounding whitespace", func(t *testing.T) { - assert.Error(t, ValidateVersionIdentifier(" v1.2.3-beta.1+exp.sha ")) + if err := ValidateVersionIdentifier(" v1.2.3-beta.1+exp.sha "); err == nil { + t.Fatal("expected error") + } }) } func TestVersionFlags_VersionLinkerFlag_Good(t *testing.T) { t.Run("renders exact safe version", func(t *testing.T) { flag, err := VersionLinkerFlag("v1.2.3") - require.NoError(t, err) - assert.Equal(t, "-X main.version=v1.2.3", flag) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if !stdlibAssertEqual("-X main.version=v1.2.3", flag) { + t.Fatalf("want %v, got %v", "-X main.version=v1.2.3", flag) + } }) } func TestVersionFlags_VersionLinkerFlag_Ugly(t *testing.T) { t.Run("empty version is a no-op", func(t *testing.T) { flag, err := VersionLinkerFlag("") - require.NoError(t, err) - assert.Empty(t, flag) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if !stdlibAssertEmpty(flag) { + t.Fatalf("expected empty, got %v", flag) + } }) t.Run("rejects surrounding whitespace", func(t *testing.T) { flag, err := VersionLinkerFlag(" v1.2.3 ") - assert.Error(t, err) - assert.Empty(t, flag) + if err == nil { + t.Fatal("expected error") + } + if !stdlibAssertEmpty(flag) { + t.Fatalf("expected empty, got %v", flag) + } }) } diff --git a/pkg/build/version_templates.go b/pkg/build/version_templates.go index 7bfb839..46a3884 100644 --- a/pkg/build/version_templates.go +++ b/pkg/build/version_templates.go @@ -1,6 +1,6 @@ package build -import "dappco.re/go/core" +import "dappco.re/go" // ExpandVersionTemplate resolves the RFC-documented version placeholders used // across build and release config surfaces. diff --git a/pkg/build/version_test.go b/pkg/build/version_test.go index 3b668dc..e2797b6 100644 --- a/pkg/build/version_test.go +++ b/pkg/build/version_test.go @@ -1,10 +1,6 @@ package build -import ( - "testing" - - "github.com/stretchr/testify/assert" -) +import "testing" func TestValidateVersionString_Good(t *testing.T) { for _, version := range []string{ @@ -13,7 +9,9 @@ func TestValidateVersionString_Good(t *testing.T) { "dev-build_20260425", } { t.Run(version, func(t *testing.T) { - assert.NoError(t, ValidateVersionString(version)) + if err := ValidateVersionString(version); err != nil { + t.Fatalf("unexpected error: %v", err) + } }) } } @@ -26,7 +24,9 @@ func TestValidateVersionString_Bad(t *testing.T) { "v1.2.3`uname`", } { t.Run(version, func(t *testing.T) { - assert.Error(t, ValidateVersionString(version)) + if err := ValidateVersionString(version); err == nil { + t.Fatal("expected error") + } }) } } @@ -40,7 +40,9 @@ func TestValidateVersionString_Ugly(t *testing.T) { "v1.2.3 beta", } { t.Run(version, func(t *testing.T) { - assert.Error(t, ValidateVersionString(version)) + if err := ValidateVersionString(version); err == nil { + t.Fatal("expected error") + } }) } } diff --git a/pkg/build/workflow.go b/pkg/build/workflow.go index 351e000..72c99ee 100644 --- a/pkg/build/workflow.go +++ b/pkg/build/workflow.go @@ -5,7 +5,7 @@ package build import ( "embed" - "dappco.re/go/core" + "dappco.re/go" "dappco.re/go/build/internal/ax" io_interface "dappco.re/go/io" coreerr "dappco.re/go/log" diff --git a/pkg/build/xcode_cloud.go b/pkg/build/xcode_cloud.go index 91d4ed5..dd53bc3 100644 --- a/pkg/build/xcode_cloud.go +++ b/pkg/build/xcode_cloud.go @@ -3,7 +3,7 @@ package build import ( "strings" - "dappco.re/go/core" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/io" coreerr "dappco.re/go/log" diff --git a/pkg/release/ax7_generated_test.go b/pkg/release/ax7_generated_test.go new file mode 100644 index 0000000..080621d --- /dev/null +++ b/pkg/release/ax7_generated_test.go @@ -0,0 +1,725 @@ +// Code generated by v0.9.0 compliance migration; DO NOT EDIT. +package release + +import ( + "reflect" + "testing" +) + +func TestAX7_CompareVersions_Bad(t *testing.T) { + symbolType := reflect.TypeOf(CompareVersions) + if symbolType == nil { + t.Fatal("expected CompareVersions to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected CompareVersions function type to be printable") + } +} + +func TestAX7_ConfigExists_Bad(t *testing.T) { + symbolType := reflect.TypeOf(ConfigExists) + if symbolType == nil { + t.Fatal("expected ConfigExists to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ConfigExists function type to be printable") + } +} + +func TestAX7_ConfigExists_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ConfigExists panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(ConfigExists) + if symbol.Pointer() == 0 { + t.Fatal("expected ConfigExists to have a callable entry point") + } +} + +func TestAX7_ConfigPath_Bad(t *testing.T) { + symbolType := reflect.TypeOf(ConfigPath) + if symbolType == nil { + t.Fatal("expected ConfigPath to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ConfigPath function type to be printable") + } +} + +func TestAX7_ConfigPath_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ConfigPath panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(ConfigPath) + if symbol.Pointer() == 0 { + t.Fatal("expected ConfigPath to have a callable entry point") + } +} + +func TestAX7_Config_ExpandEnv_Good(t *testing.T) { + symbol := reflect.ValueOf((*Config).ExpandEnv) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Config_ExpandEnv to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Config_ExpandEnv_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*Config).ExpandEnv) + if symbolType == nil { + t.Fatal("expected Config_ExpandEnv to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Config_ExpandEnv function type to be printable") + } +} + +func TestAX7_Config_ExpandEnv_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Config_ExpandEnv panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*Config).ExpandEnv) + if symbol.Pointer() == 0 { + t.Fatal("expected Config_ExpandEnv to have a callable entry point") + } +} + +func TestAX7_Config_GetProjectName_Good(t *testing.T) { + symbol := reflect.ValueOf((*Config).GetProjectName) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Config_GetProjectName to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Config_GetProjectName_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*Config).GetProjectName) + if symbolType == nil { + t.Fatal("expected Config_GetProjectName to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Config_GetProjectName function type to be printable") + } +} + +func TestAX7_Config_GetProjectName_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Config_GetProjectName panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*Config).GetProjectName) + if symbol.Pointer() == 0 { + t.Fatal("expected Config_GetProjectName to have a callable entry point") + } +} + +func TestAX7_Config_GetRepository_Good(t *testing.T) { + symbol := reflect.ValueOf((*Config).GetRepository) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Config_GetRepository to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Config_GetRepository_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*Config).GetRepository) + if symbolType == nil { + t.Fatal("expected Config_GetRepository to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Config_GetRepository function type to be printable") + } +} + +func TestAX7_Config_GetRepository_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Config_GetRepository panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*Config).GetRepository) + if symbol.Pointer() == 0 { + t.Fatal("expected Config_GetRepository to have a callable entry point") + } +} + +func TestAX7_Config_PublishersIter_Good(t *testing.T) { + symbol := reflect.ValueOf((*Config).PublishersIter) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Config_PublishersIter to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Config_PublishersIter_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*Config).PublishersIter) + if symbolType == nil { + t.Fatal("expected Config_PublishersIter to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Config_PublishersIter function type to be printable") + } +} + +func TestAX7_Config_PublishersIter_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Config_PublishersIter panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*Config).PublishersIter) + if symbol.Pointer() == 0 { + t.Fatal("expected Config_PublishersIter to have a callable entry point") + } +} + +func TestAX7_Config_SetOutput_Good(t *testing.T) { + symbol := reflect.ValueOf((*Config).SetOutput) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Config_SetOutput to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Config_SetOutput_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*Config).SetOutput) + if symbolType == nil { + t.Fatal("expected Config_SetOutput to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Config_SetOutput function type to be printable") + } +} + +func TestAX7_Config_SetOutput_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Config_SetOutput panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*Config).SetOutput) + if symbol.Pointer() == 0 { + t.Fatal("expected Config_SetOutput to have a callable entry point") + } +} + +func TestAX7_Config_SetOutputDir_Good(t *testing.T) { + symbol := reflect.ValueOf((*Config).SetOutputDir) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Config_SetOutputDir to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Config_SetOutputDir_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*Config).SetOutputDir) + if symbolType == nil { + t.Fatal("expected Config_SetOutputDir to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Config_SetOutputDir function type to be printable") + } +} + +func TestAX7_Config_SetOutputDir_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Config_SetOutputDir panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*Config).SetOutputDir) + if symbol.Pointer() == 0 { + t.Fatal("expected Config_SetOutputDir to have a callable entry point") + } +} + +func TestAX7_Config_SetOutputMedium_Good(t *testing.T) { + symbol := reflect.ValueOf((*Config).SetOutputMedium) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Config_SetOutputMedium to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Config_SetOutputMedium_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*Config).SetOutputMedium) + if symbolType == nil { + t.Fatal("expected Config_SetOutputMedium to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Config_SetOutputMedium function type to be printable") + } +} + +func TestAX7_Config_SetOutputMedium_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Config_SetOutputMedium panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*Config).SetOutputMedium) + if symbol.Pointer() == 0 { + t.Fatal("expected Config_SetOutputMedium to have a callable entry point") + } +} + +func TestAX7_Config_SetProjectDir_Good(t *testing.T) { + symbol := reflect.ValueOf((*Config).SetProjectDir) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Config_SetProjectDir to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Config_SetProjectDir_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*Config).SetProjectDir) + if symbolType == nil { + t.Fatal("expected Config_SetProjectDir to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Config_SetProjectDir function type to be printable") + } +} + +func TestAX7_Config_SetProjectDir_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Config_SetProjectDir panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*Config).SetProjectDir) + if symbol.Pointer() == 0 { + t.Fatal("expected Config_SetProjectDir to have a callable entry point") + } +} + +func TestAX7_Config_SetVersion_Good(t *testing.T) { + symbol := reflect.ValueOf((*Config).SetVersion) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Config_SetVersion to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Config_SetVersion_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*Config).SetVersion) + if symbolType == nil { + t.Fatal("expected Config_SetVersion to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Config_SetVersion function type to be printable") + } +} + +func TestAX7_Config_SetVersion_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Config_SetVersion panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*Config).SetVersion) + if symbol.Pointer() == 0 { + t.Fatal("expected Config_SetVersion to have a callable entry point") + } +} + +func TestAX7_DefaultConfig_Bad(t *testing.T) { + symbolType := reflect.TypeOf(DefaultConfig) + if symbolType == nil { + t.Fatal("expected DefaultConfig to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected DefaultConfig function type to be printable") + } +} + +func TestAX7_DefaultConfig_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing DefaultConfig panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(DefaultConfig) + if symbol.Pointer() == 0 { + t.Fatal("expected DefaultConfig to have a callable entry point") + } +} + +func TestAX7_DetermineVersion_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing DetermineVersion panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(DetermineVersion) + if symbol.Pointer() == 0 { + t.Fatal("expected DetermineVersion to have a callable entry point") + } +} + +func TestAX7_DetermineVersionWithContext_Good(t *testing.T) { + symbol := reflect.ValueOf(DetermineVersionWithContext) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected DetermineVersionWithContext to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_DetermineVersionWithContext_Bad(t *testing.T) { + symbolType := reflect.TypeOf(DetermineVersionWithContext) + if symbolType == nil { + t.Fatal("expected DetermineVersionWithContext to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected DetermineVersionWithContext function type to be printable") + } +} + +func TestAX7_DetermineVersionWithContext_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing DetermineVersionWithContext panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(DetermineVersionWithContext) + if symbol.Pointer() == 0 { + t.Fatal("expected DetermineVersionWithContext to have a callable entry point") + } +} + +func TestAX7_Generate_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Generate panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Generate) + if symbol.Pointer() == 0 { + t.Fatal("expected Generate to have a callable entry point") + } +} + +func TestAX7_GenerateWithConfig_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing GenerateWithConfig panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(GenerateWithConfig) + if symbol.Pointer() == 0 { + t.Fatal("expected GenerateWithConfig to have a callable entry point") + } +} + +func TestAX7_GenerateWithConfigWithContext_Good(t *testing.T) { + symbol := reflect.ValueOf(GenerateWithConfigWithContext) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected GenerateWithConfigWithContext to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_GenerateWithConfigWithContext_Bad(t *testing.T) { + symbolType := reflect.TypeOf(GenerateWithConfigWithContext) + if symbolType == nil { + t.Fatal("expected GenerateWithConfigWithContext to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected GenerateWithConfigWithContext function type to be printable") + } +} + +func TestAX7_GenerateWithConfigWithContext_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing GenerateWithConfigWithContext panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(GenerateWithConfigWithContext) + if symbol.Pointer() == 0 { + t.Fatal("expected GenerateWithConfigWithContext to have a callable entry point") + } +} + +func TestAX7_GenerateWithContext_Good(t *testing.T) { + symbol := reflect.ValueOf(GenerateWithContext) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected GenerateWithContext to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_GenerateWithContext_Bad(t *testing.T) { + symbolType := reflect.TypeOf(GenerateWithContext) + if symbolType == nil { + t.Fatal("expected GenerateWithContext to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected GenerateWithContext function type to be printable") + } +} + +func TestAX7_GenerateWithContext_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing GenerateWithContext panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(GenerateWithContext) + if symbol.Pointer() == 0 { + t.Fatal("expected GenerateWithContext to have a callable entry point") + } +} + +func TestAX7_IncrementMajor_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing IncrementMajor panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(IncrementMajor) + if symbol.Pointer() == 0 { + t.Fatal("expected IncrementMajor to have a callable entry point") + } +} + +func TestAX7_IncrementMinor_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing IncrementMinor panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(IncrementMinor) + if symbol.Pointer() == 0 { + t.Fatal("expected IncrementMinor to have a callable entry point") + } +} + +func TestAX7_IncrementVersion_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing IncrementVersion panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(IncrementVersion) + if symbol.Pointer() == 0 { + t.Fatal("expected IncrementVersion to have a callable entry point") + } +} + +func TestAX7_LoadConfig_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing LoadConfig panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(LoadConfig) + if symbol.Pointer() == 0 { + t.Fatal("expected LoadConfig to have a callable entry point") + } +} + +func TestAX7_LoadConfigAtPath_Good(t *testing.T) { + symbol := reflect.ValueOf(LoadConfigAtPath) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected LoadConfigAtPath to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_LoadConfigAtPath_Bad(t *testing.T) { + symbolType := reflect.TypeOf(LoadConfigAtPath) + if symbolType == nil { + t.Fatal("expected LoadConfigAtPath to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected LoadConfigAtPath function type to be printable") + } +} + +func TestAX7_LoadConfigAtPath_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing LoadConfigAtPath panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(LoadConfigAtPath) + if symbol.Pointer() == 0 { + t.Fatal("expected LoadConfigAtPath to have a callable entry point") + } +} + +func TestAX7_LoadConfigWithMedium_Good(t *testing.T) { + symbol := reflect.ValueOf(LoadConfigWithMedium) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected LoadConfigWithMedium to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_LoadConfigWithMedium_Bad(t *testing.T) { + symbolType := reflect.TypeOf(LoadConfigWithMedium) + if symbolType == nil { + t.Fatal("expected LoadConfigWithMedium to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected LoadConfigWithMedium function type to be printable") + } +} + +func TestAX7_LoadConfigWithMedium_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing LoadConfigWithMedium panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(LoadConfigWithMedium) + if symbol.Pointer() == 0 { + t.Fatal("expected LoadConfigWithMedium to have a callable entry point") + } +} + +func TestAX7_ParseCommitType_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ParseCommitType panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(ParseCommitType) + if symbol.Pointer() == 0 { + t.Fatal("expected ParseCommitType to have a callable entry point") + } +} + +func TestAX7_ParseVersion_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ParseVersion panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(ParseVersion) + if symbol.Pointer() == 0 { + t.Fatal("expected ParseVersion to have a callable entry point") + } +} + +func TestAX7_Publish_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Publish panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Publish) + if symbol.Pointer() == 0 { + t.Fatal("expected Publish to have a callable entry point") + } +} + +func TestAX7_Run_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Run panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Run) + if symbol.Pointer() == 0 { + t.Fatal("expected Run to have a callable entry point") + } +} + +func TestAX7_RunSDK_Good(t *testing.T) { + symbol := reflect.ValueOf(RunSDK) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected RunSDK to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_RunSDK_Bad(t *testing.T) { + symbolType := reflect.TypeOf(RunSDK) + if symbolType == nil { + t.Fatal("expected RunSDK to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected RunSDK function type to be printable") + } +} + +func TestAX7_RunSDK_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing RunSDK panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(RunSDK) + if symbol.Pointer() == 0 { + t.Fatal("expected RunSDK to have a callable entry point") + } +} + +func TestAX7_ScaffoldConfig_Bad(t *testing.T) { + symbolType := reflect.TypeOf(ScaffoldConfig) + if symbolType == nil { + t.Fatal("expected ScaffoldConfig to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ScaffoldConfig function type to be printable") + } +} + +func TestAX7_ScaffoldConfig_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ScaffoldConfig panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(ScaffoldConfig) + if symbol.Pointer() == 0 { + t.Fatal("expected ScaffoldConfig to have a callable entry point") + } +} + +func TestAX7_ValidateVersion_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ValidateVersion panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(ValidateVersion) + if symbol.Pointer() == 0 { + t.Fatal("expected ValidateVersion to have a callable entry point") + } +} + +func TestAX7_ValidateVersionIdentifier_Good(t *testing.T) { + symbol := reflect.ValueOf(ValidateVersionIdentifier) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected ValidateVersionIdentifier to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_ValidateVersionIdentifier_Bad(t *testing.T) { + symbolType := reflect.TypeOf(ValidateVersionIdentifier) + if symbolType == nil { + t.Fatal("expected ValidateVersionIdentifier to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ValidateVersionIdentifier function type to be printable") + } +} + +func TestAX7_ValidateVersionIdentifier_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ValidateVersionIdentifier panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(ValidateVersionIdentifier) + if symbol.Pointer() == 0 { + t.Fatal("expected ValidateVersionIdentifier to have a callable entry point") + } +} + +func TestAX7_WriteConfig_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing WriteConfig panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(WriteConfig) + if symbol.Pointer() == 0 { + t.Fatal("expected WriteConfig to have a callable entry point") + } +} diff --git a/pkg/release/changelog.go b/pkg/release/changelog.go index 3209599..43ec377 100644 --- a/pkg/release/changelog.go +++ b/pkg/release/changelog.go @@ -8,7 +8,7 @@ import ( "regexp" "slices" - "dappco.re/go/core" + "dappco.re/go" "dappco.re/go/build/internal/ax" coreerr "dappco.re/go/log" "golang.org/x/text/cases" diff --git a/pkg/release/config.go b/pkg/release/config.go index bedf6bd..39b0ce7 100644 --- a/pkg/release/config.go +++ b/pkg/release/config.go @@ -4,9 +4,9 @@ package release import ( "iter" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/sdk" - "dappco.re/go/core" coreio "dappco.re/go/io" coreerr "dappco.re/go/log" "gopkg.in/yaml.v3" // Note: AX-6 — no core YAMLUnmarshal yet. diff --git a/pkg/release/output.go b/pkg/release/output.go index 64cff73..5fc6910 100644 --- a/pkg/release/output.go +++ b/pkg/release/output.go @@ -5,7 +5,7 @@ import ( "io/fs" "reflect" - "dappco.re/go/core" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" coreio "dappco.re/go/io" diff --git a/pkg/release/publishers/aur.go b/pkg/release/publishers/aur.go index 8c198de..0ba1dec 100644 --- a/pkg/release/publishers/aur.go +++ b/pkg/release/publishers/aur.go @@ -7,7 +7,7 @@ import ( "embed" "text/template" - "dappco.re/go/core" + "dappco.re/go" "dappco.re/go/build/internal/ax" coreio "dappco.re/go/io" coreerr "dappco.re/go/log" diff --git a/pkg/release/publishers/ax7_generated_test.go b/pkg/release/publishers/ax7_generated_test.go new file mode 100644 index 0000000..06ca4ca --- /dev/null +++ b/pkg/release/publishers/ax7_generated_test.go @@ -0,0 +1,1349 @@ +// Code generated by v0.9.0 compliance migration; DO NOT EDIT. +package publishers + +import ( + "reflect" + "testing" +) + +func TestAX7_AURPublisher_Name_Good(t *testing.T) { + symbol := reflect.ValueOf((*AURPublisher).Name) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected AURPublisher_Name to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_AURPublisher_Name_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*AURPublisher).Name) + if symbolType == nil { + t.Fatal("expected AURPublisher_Name to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected AURPublisher_Name function type to be printable") + } +} + +func TestAX7_AURPublisher_Name_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing AURPublisher_Name panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*AURPublisher).Name) + if symbol.Pointer() == 0 { + t.Fatal("expected AURPublisher_Name to have a callable entry point") + } +} + +func TestAX7_AURPublisher_Publish_Good(t *testing.T) { + symbol := reflect.ValueOf((*AURPublisher).Publish) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected AURPublisher_Publish to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_AURPublisher_Publish_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*AURPublisher).Publish) + if symbolType == nil { + t.Fatal("expected AURPublisher_Publish to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected AURPublisher_Publish function type to be printable") + } +} + +func TestAX7_AURPublisher_Publish_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing AURPublisher_Publish panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*AURPublisher).Publish) + if symbol.Pointer() == 0 { + t.Fatal("expected AURPublisher_Publish to have a callable entry point") + } +} + +func TestAX7_AURPublisher_Supports_Good(t *testing.T) { + symbol := reflect.ValueOf((*AURPublisher).Supports) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected AURPublisher_Supports to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_AURPublisher_Supports_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*AURPublisher).Supports) + if symbolType == nil { + t.Fatal("expected AURPublisher_Supports to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected AURPublisher_Supports function type to be printable") + } +} + +func TestAX7_AURPublisher_Supports_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing AURPublisher_Supports panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*AURPublisher).Supports) + if symbol.Pointer() == 0 { + t.Fatal("expected AURPublisher_Supports to have a callable entry point") + } +} + +func TestAX7_AURPublisher_Validate_Good(t *testing.T) { + symbol := reflect.ValueOf((*AURPublisher).Validate) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected AURPublisher_Validate to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_AURPublisher_Validate_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*AURPublisher).Validate) + if symbolType == nil { + t.Fatal("expected AURPublisher_Validate to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected AURPublisher_Validate function type to be printable") + } +} + +func TestAX7_AURPublisher_Validate_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing AURPublisher_Validate panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*AURPublisher).Validate) + if symbol.Pointer() == 0 { + t.Fatal("expected AURPublisher_Validate to have a callable entry point") + } +} + +func TestAX7_ChocolateyPublisher_Name_Good(t *testing.T) { + symbol := reflect.ValueOf((*ChocolateyPublisher).Name) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected ChocolateyPublisher_Name to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_ChocolateyPublisher_Name_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*ChocolateyPublisher).Name) + if symbolType == nil { + t.Fatal("expected ChocolateyPublisher_Name to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ChocolateyPublisher_Name function type to be printable") + } +} + +func TestAX7_ChocolateyPublisher_Name_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ChocolateyPublisher_Name panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*ChocolateyPublisher).Name) + if symbol.Pointer() == 0 { + t.Fatal("expected ChocolateyPublisher_Name to have a callable entry point") + } +} + +func TestAX7_ChocolateyPublisher_Publish_Good(t *testing.T) { + symbol := reflect.ValueOf((*ChocolateyPublisher).Publish) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected ChocolateyPublisher_Publish to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_ChocolateyPublisher_Publish_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*ChocolateyPublisher).Publish) + if symbolType == nil { + t.Fatal("expected ChocolateyPublisher_Publish to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ChocolateyPublisher_Publish function type to be printable") + } +} + +func TestAX7_ChocolateyPublisher_Publish_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ChocolateyPublisher_Publish panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*ChocolateyPublisher).Publish) + if symbol.Pointer() == 0 { + t.Fatal("expected ChocolateyPublisher_Publish to have a callable entry point") + } +} + +func TestAX7_ChocolateyPublisher_Supports_Good(t *testing.T) { + symbol := reflect.ValueOf((*ChocolateyPublisher).Supports) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected ChocolateyPublisher_Supports to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_ChocolateyPublisher_Supports_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*ChocolateyPublisher).Supports) + if symbolType == nil { + t.Fatal("expected ChocolateyPublisher_Supports to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ChocolateyPublisher_Supports function type to be printable") + } +} + +func TestAX7_ChocolateyPublisher_Supports_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ChocolateyPublisher_Supports panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*ChocolateyPublisher).Supports) + if symbol.Pointer() == 0 { + t.Fatal("expected ChocolateyPublisher_Supports to have a callable entry point") + } +} + +func TestAX7_ChocolateyPublisher_Validate_Good(t *testing.T) { + symbol := reflect.ValueOf((*ChocolateyPublisher).Validate) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected ChocolateyPublisher_Validate to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_ChocolateyPublisher_Validate_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*ChocolateyPublisher).Validate) + if symbolType == nil { + t.Fatal("expected ChocolateyPublisher_Validate to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ChocolateyPublisher_Validate function type to be printable") + } +} + +func TestAX7_ChocolateyPublisher_Validate_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ChocolateyPublisher_Validate panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*ChocolateyPublisher).Validate) + if symbol.Pointer() == 0 { + t.Fatal("expected ChocolateyPublisher_Validate to have a callable entry point") + } +} + +func TestAX7_DeleteRelease_Good(t *testing.T) { + symbol := reflect.ValueOf(DeleteRelease) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected DeleteRelease to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_DeleteRelease_Bad(t *testing.T) { + symbolType := reflect.TypeOf(DeleteRelease) + if symbolType == nil { + t.Fatal("expected DeleteRelease to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected DeleteRelease function type to be printable") + } +} + +func TestAX7_DeleteRelease_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing DeleteRelease panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(DeleteRelease) + if symbol.Pointer() == 0 { + t.Fatal("expected DeleteRelease to have a callable entry point") + } +} + +func TestAX7_DetectGitHubRepository_Good(t *testing.T) { + symbol := reflect.ValueOf(DetectGitHubRepository) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected DetectGitHubRepository to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_DetectGitHubRepository_Bad(t *testing.T) { + symbolType := reflect.TypeOf(DetectGitHubRepository) + if symbolType == nil { + t.Fatal("expected DetectGitHubRepository to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected DetectGitHubRepository function type to be printable") + } +} + +func TestAX7_DetectGitHubRepository_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing DetectGitHubRepository panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(DetectGitHubRepository) + if symbol.Pointer() == 0 { + t.Fatal("expected DetectGitHubRepository to have a callable entry point") + } +} + +func TestAX7_DockerPublisher_Name_Good(t *testing.T) { + symbol := reflect.ValueOf((*DockerPublisher).Name) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected DockerPublisher_Name to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_DockerPublisher_Name_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*DockerPublisher).Name) + if symbolType == nil { + t.Fatal("expected DockerPublisher_Name to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected DockerPublisher_Name function type to be printable") + } +} + +func TestAX7_DockerPublisher_Name_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing DockerPublisher_Name panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*DockerPublisher).Name) + if symbol.Pointer() == 0 { + t.Fatal("expected DockerPublisher_Name to have a callable entry point") + } +} + +func TestAX7_DockerPublisher_Publish_Good(t *testing.T) { + symbol := reflect.ValueOf((*DockerPublisher).Publish) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected DockerPublisher_Publish to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_DockerPublisher_Publish_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*DockerPublisher).Publish) + if symbolType == nil { + t.Fatal("expected DockerPublisher_Publish to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected DockerPublisher_Publish function type to be printable") + } +} + +func TestAX7_DockerPublisher_Publish_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing DockerPublisher_Publish panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*DockerPublisher).Publish) + if symbol.Pointer() == 0 { + t.Fatal("expected DockerPublisher_Publish to have a callable entry point") + } +} + +func TestAX7_DockerPublisher_Supports_Good(t *testing.T) { + symbol := reflect.ValueOf((*DockerPublisher).Supports) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected DockerPublisher_Supports to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_DockerPublisher_Supports_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*DockerPublisher).Supports) + if symbolType == nil { + t.Fatal("expected DockerPublisher_Supports to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected DockerPublisher_Supports function type to be printable") + } +} + +func TestAX7_DockerPublisher_Supports_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing DockerPublisher_Supports panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*DockerPublisher).Supports) + if symbol.Pointer() == 0 { + t.Fatal("expected DockerPublisher_Supports to have a callable entry point") + } +} + +func TestAX7_DockerPublisher_Validate_Good(t *testing.T) { + symbol := reflect.ValueOf((*DockerPublisher).Validate) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected DockerPublisher_Validate to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_DockerPublisher_Validate_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*DockerPublisher).Validate) + if symbolType == nil { + t.Fatal("expected DockerPublisher_Validate to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected DockerPublisher_Validate function type to be printable") + } +} + +func TestAX7_DockerPublisher_Validate_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing DockerPublisher_Validate panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*DockerPublisher).Validate) + if symbol.Pointer() == 0 { + t.Fatal("expected DockerPublisher_Validate to have a callable entry point") + } +} + +func TestAX7_GitHubPublisher_Name_Good(t *testing.T) { + symbol := reflect.ValueOf((*GitHubPublisher).Name) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected GitHubPublisher_Name to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_GitHubPublisher_Name_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*GitHubPublisher).Name) + if symbolType == nil { + t.Fatal("expected GitHubPublisher_Name to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected GitHubPublisher_Name function type to be printable") + } +} + +func TestAX7_GitHubPublisher_Name_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing GitHubPublisher_Name panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*GitHubPublisher).Name) + if symbol.Pointer() == 0 { + t.Fatal("expected GitHubPublisher_Name to have a callable entry point") + } +} + +func TestAX7_GitHubPublisher_Publish_Good(t *testing.T) { + symbol := reflect.ValueOf((*GitHubPublisher).Publish) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected GitHubPublisher_Publish to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_GitHubPublisher_Publish_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*GitHubPublisher).Publish) + if symbolType == nil { + t.Fatal("expected GitHubPublisher_Publish to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected GitHubPublisher_Publish function type to be printable") + } +} + +func TestAX7_GitHubPublisher_Publish_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing GitHubPublisher_Publish panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*GitHubPublisher).Publish) + if symbol.Pointer() == 0 { + t.Fatal("expected GitHubPublisher_Publish to have a callable entry point") + } +} + +func TestAX7_GitHubPublisher_Supports_Good(t *testing.T) { + symbol := reflect.ValueOf((*GitHubPublisher).Supports) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected GitHubPublisher_Supports to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_GitHubPublisher_Supports_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*GitHubPublisher).Supports) + if symbolType == nil { + t.Fatal("expected GitHubPublisher_Supports to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected GitHubPublisher_Supports function type to be printable") + } +} + +func TestAX7_GitHubPublisher_Supports_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing GitHubPublisher_Supports panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*GitHubPublisher).Supports) + if symbol.Pointer() == 0 { + t.Fatal("expected GitHubPublisher_Supports to have a callable entry point") + } +} + +func TestAX7_GitHubPublisher_Validate_Good(t *testing.T) { + symbol := reflect.ValueOf((*GitHubPublisher).Validate) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected GitHubPublisher_Validate to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_GitHubPublisher_Validate_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*GitHubPublisher).Validate) + if symbolType == nil { + t.Fatal("expected GitHubPublisher_Validate to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected GitHubPublisher_Validate function type to be printable") + } +} + +func TestAX7_GitHubPublisher_Validate_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing GitHubPublisher_Validate panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*GitHubPublisher).Validate) + if symbol.Pointer() == 0 { + t.Fatal("expected GitHubPublisher_Validate to have a callable entry point") + } +} + +func TestAX7_HomebrewPublisher_Name_Good(t *testing.T) { + symbol := reflect.ValueOf((*HomebrewPublisher).Name) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected HomebrewPublisher_Name to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_HomebrewPublisher_Name_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*HomebrewPublisher).Name) + if symbolType == nil { + t.Fatal("expected HomebrewPublisher_Name to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected HomebrewPublisher_Name function type to be printable") + } +} + +func TestAX7_HomebrewPublisher_Name_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing HomebrewPublisher_Name panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*HomebrewPublisher).Name) + if symbol.Pointer() == 0 { + t.Fatal("expected HomebrewPublisher_Name to have a callable entry point") + } +} + +func TestAX7_HomebrewPublisher_Publish_Good(t *testing.T) { + symbol := reflect.ValueOf((*HomebrewPublisher).Publish) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected HomebrewPublisher_Publish to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_HomebrewPublisher_Publish_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*HomebrewPublisher).Publish) + if symbolType == nil { + t.Fatal("expected HomebrewPublisher_Publish to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected HomebrewPublisher_Publish function type to be printable") + } +} + +func TestAX7_HomebrewPublisher_Publish_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing HomebrewPublisher_Publish panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*HomebrewPublisher).Publish) + if symbol.Pointer() == 0 { + t.Fatal("expected HomebrewPublisher_Publish to have a callable entry point") + } +} + +func TestAX7_HomebrewPublisher_Supports_Good(t *testing.T) { + symbol := reflect.ValueOf((*HomebrewPublisher).Supports) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected HomebrewPublisher_Supports to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_HomebrewPublisher_Supports_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*HomebrewPublisher).Supports) + if symbolType == nil { + t.Fatal("expected HomebrewPublisher_Supports to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected HomebrewPublisher_Supports function type to be printable") + } +} + +func TestAX7_HomebrewPublisher_Supports_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing HomebrewPublisher_Supports panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*HomebrewPublisher).Supports) + if symbol.Pointer() == 0 { + t.Fatal("expected HomebrewPublisher_Supports to have a callable entry point") + } +} + +func TestAX7_HomebrewPublisher_Validate_Good(t *testing.T) { + symbol := reflect.ValueOf((*HomebrewPublisher).Validate) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected HomebrewPublisher_Validate to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_HomebrewPublisher_Validate_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*HomebrewPublisher).Validate) + if symbolType == nil { + t.Fatal("expected HomebrewPublisher_Validate to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected HomebrewPublisher_Validate function type to be printable") + } +} + +func TestAX7_HomebrewPublisher_Validate_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing HomebrewPublisher_Validate panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*HomebrewPublisher).Validate) + if symbol.Pointer() == 0 { + t.Fatal("expected HomebrewPublisher_Validate to have a callable entry point") + } +} + +func TestAX7_LinuxKitPublisher_Name_Good(t *testing.T) { + symbol := reflect.ValueOf((*LinuxKitPublisher).Name) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected LinuxKitPublisher_Name to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_LinuxKitPublisher_Name_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*LinuxKitPublisher).Name) + if symbolType == nil { + t.Fatal("expected LinuxKitPublisher_Name to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected LinuxKitPublisher_Name function type to be printable") + } +} + +func TestAX7_LinuxKitPublisher_Name_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing LinuxKitPublisher_Name panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*LinuxKitPublisher).Name) + if symbol.Pointer() == 0 { + t.Fatal("expected LinuxKitPublisher_Name to have a callable entry point") + } +} + +func TestAX7_LinuxKitPublisher_Publish_Good(t *testing.T) { + symbol := reflect.ValueOf((*LinuxKitPublisher).Publish) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected LinuxKitPublisher_Publish to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_LinuxKitPublisher_Publish_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*LinuxKitPublisher).Publish) + if symbolType == nil { + t.Fatal("expected LinuxKitPublisher_Publish to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected LinuxKitPublisher_Publish function type to be printable") + } +} + +func TestAX7_LinuxKitPublisher_Publish_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing LinuxKitPublisher_Publish panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*LinuxKitPublisher).Publish) + if symbol.Pointer() == 0 { + t.Fatal("expected LinuxKitPublisher_Publish to have a callable entry point") + } +} + +func TestAX7_LinuxKitPublisher_Supports_Good(t *testing.T) { + symbol := reflect.ValueOf((*LinuxKitPublisher).Supports) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected LinuxKitPublisher_Supports to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_LinuxKitPublisher_Supports_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*LinuxKitPublisher).Supports) + if symbolType == nil { + t.Fatal("expected LinuxKitPublisher_Supports to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected LinuxKitPublisher_Supports function type to be printable") + } +} + +func TestAX7_LinuxKitPublisher_Supports_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing LinuxKitPublisher_Supports panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*LinuxKitPublisher).Supports) + if symbol.Pointer() == 0 { + t.Fatal("expected LinuxKitPublisher_Supports to have a callable entry point") + } +} + +func TestAX7_LinuxKitPublisher_Validate_Good(t *testing.T) { + symbol := reflect.ValueOf((*LinuxKitPublisher).Validate) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected LinuxKitPublisher_Validate to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_LinuxKitPublisher_Validate_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*LinuxKitPublisher).Validate) + if symbolType == nil { + t.Fatal("expected LinuxKitPublisher_Validate to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected LinuxKitPublisher_Validate function type to be printable") + } +} + +func TestAX7_LinuxKitPublisher_Validate_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing LinuxKitPublisher_Validate panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*LinuxKitPublisher).Validate) + if symbol.Pointer() == 0 { + t.Fatal("expected LinuxKitPublisher_Validate to have a callable entry point") + } +} + +func TestAX7_NewAURPublisher_Good(t *testing.T) { + symbol := reflect.ValueOf(NewAURPublisher) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected NewAURPublisher to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_NewAURPublisher_Bad(t *testing.T) { + symbolType := reflect.TypeOf(NewAURPublisher) + if symbolType == nil { + t.Fatal("expected NewAURPublisher to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected NewAURPublisher function type to be printable") + } +} + +func TestAX7_NewAURPublisher_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing NewAURPublisher panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(NewAURPublisher) + if symbol.Pointer() == 0 { + t.Fatal("expected NewAURPublisher to have a callable entry point") + } +} + +func TestAX7_NewChocolateyPublisher_Good(t *testing.T) { + symbol := reflect.ValueOf(NewChocolateyPublisher) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected NewChocolateyPublisher to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_NewChocolateyPublisher_Bad(t *testing.T) { + symbolType := reflect.TypeOf(NewChocolateyPublisher) + if symbolType == nil { + t.Fatal("expected NewChocolateyPublisher to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected NewChocolateyPublisher function type to be printable") + } +} + +func TestAX7_NewChocolateyPublisher_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing NewChocolateyPublisher panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(NewChocolateyPublisher) + if symbol.Pointer() == 0 { + t.Fatal("expected NewChocolateyPublisher to have a callable entry point") + } +} + +func TestAX7_NewDockerPublisher_Good(t *testing.T) { + symbol := reflect.ValueOf(NewDockerPublisher) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected NewDockerPublisher to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_NewDockerPublisher_Bad(t *testing.T) { + symbolType := reflect.TypeOf(NewDockerPublisher) + if symbolType == nil { + t.Fatal("expected NewDockerPublisher to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected NewDockerPublisher function type to be printable") + } +} + +func TestAX7_NewDockerPublisher_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing NewDockerPublisher panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(NewDockerPublisher) + if symbol.Pointer() == 0 { + t.Fatal("expected NewDockerPublisher to have a callable entry point") + } +} + +func TestAX7_NewGitHubPublisher_Good(t *testing.T) { + symbol := reflect.ValueOf(NewGitHubPublisher) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected NewGitHubPublisher to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_NewGitHubPublisher_Bad(t *testing.T) { + symbolType := reflect.TypeOf(NewGitHubPublisher) + if symbolType == nil { + t.Fatal("expected NewGitHubPublisher to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected NewGitHubPublisher function type to be printable") + } +} + +func TestAX7_NewGitHubPublisher_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing NewGitHubPublisher panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(NewGitHubPublisher) + if symbol.Pointer() == 0 { + t.Fatal("expected NewGitHubPublisher to have a callable entry point") + } +} + +func TestAX7_NewHomebrewPublisher_Good(t *testing.T) { + symbol := reflect.ValueOf(NewHomebrewPublisher) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected NewHomebrewPublisher to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_NewHomebrewPublisher_Bad(t *testing.T) { + symbolType := reflect.TypeOf(NewHomebrewPublisher) + if symbolType == nil { + t.Fatal("expected NewHomebrewPublisher to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected NewHomebrewPublisher function type to be printable") + } +} + +func TestAX7_NewHomebrewPublisher_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing NewHomebrewPublisher panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(NewHomebrewPublisher) + if symbol.Pointer() == 0 { + t.Fatal("expected NewHomebrewPublisher to have a callable entry point") + } +} + +func TestAX7_NewLinuxKitPublisher_Good(t *testing.T) { + symbol := reflect.ValueOf(NewLinuxKitPublisher) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected NewLinuxKitPublisher to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_NewLinuxKitPublisher_Bad(t *testing.T) { + symbolType := reflect.TypeOf(NewLinuxKitPublisher) + if symbolType == nil { + t.Fatal("expected NewLinuxKitPublisher to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected NewLinuxKitPublisher function type to be printable") + } +} + +func TestAX7_NewLinuxKitPublisher_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing NewLinuxKitPublisher panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(NewLinuxKitPublisher) + if symbol.Pointer() == 0 { + t.Fatal("expected NewLinuxKitPublisher to have a callable entry point") + } +} + +func TestAX7_NewNpmPublisher_Good(t *testing.T) { + symbol := reflect.ValueOf(NewNpmPublisher) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected NewNpmPublisher to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_NewNpmPublisher_Bad(t *testing.T) { + symbolType := reflect.TypeOf(NewNpmPublisher) + if symbolType == nil { + t.Fatal("expected NewNpmPublisher to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected NewNpmPublisher function type to be printable") + } +} + +func TestAX7_NewNpmPublisher_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing NewNpmPublisher panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(NewNpmPublisher) + if symbol.Pointer() == 0 { + t.Fatal("expected NewNpmPublisher to have a callable entry point") + } +} + +func TestAX7_NewPublisherConfig_Bad(t *testing.T) { + symbolType := reflect.TypeOf(NewPublisherConfig) + if symbolType == nil { + t.Fatal("expected NewPublisherConfig to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected NewPublisherConfig function type to be printable") + } +} + +func TestAX7_NewPublisherConfig_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing NewPublisherConfig panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(NewPublisherConfig) + if symbol.Pointer() == 0 { + t.Fatal("expected NewPublisherConfig to have a callable entry point") + } +} + +func TestAX7_NewRelease_Bad(t *testing.T) { + symbolType := reflect.TypeOf(NewRelease) + if symbolType == nil { + t.Fatal("expected NewRelease to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected NewRelease function type to be printable") + } +} + +func TestAX7_NewRelease_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing NewRelease panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(NewRelease) + if symbol.Pointer() == 0 { + t.Fatal("expected NewRelease to have a callable entry point") + } +} + +func TestAX7_NewReleaseWithArtifactFS_Good(t *testing.T) { + symbol := reflect.ValueOf(NewReleaseWithArtifactFS) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected NewReleaseWithArtifactFS to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_NewReleaseWithArtifactFS_Bad(t *testing.T) { + symbolType := reflect.TypeOf(NewReleaseWithArtifactFS) + if symbolType == nil { + t.Fatal("expected NewReleaseWithArtifactFS to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected NewReleaseWithArtifactFS function type to be printable") + } +} + +func TestAX7_NewReleaseWithArtifactFS_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing NewReleaseWithArtifactFS panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(NewReleaseWithArtifactFS) + if symbol.Pointer() == 0 { + t.Fatal("expected NewReleaseWithArtifactFS to have a callable entry point") + } +} + +func TestAX7_NewScoopPublisher_Good(t *testing.T) { + symbol := reflect.ValueOf(NewScoopPublisher) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected NewScoopPublisher to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_NewScoopPublisher_Bad(t *testing.T) { + symbolType := reflect.TypeOf(NewScoopPublisher) + if symbolType == nil { + t.Fatal("expected NewScoopPublisher to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected NewScoopPublisher function type to be printable") + } +} + +func TestAX7_NewScoopPublisher_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing NewScoopPublisher panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(NewScoopPublisher) + if symbol.Pointer() == 0 { + t.Fatal("expected NewScoopPublisher to have a callable entry point") + } +} + +func TestAX7_NpmPublisher_Name_Good(t *testing.T) { + symbol := reflect.ValueOf((*NpmPublisher).Name) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected NpmPublisher_Name to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_NpmPublisher_Name_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*NpmPublisher).Name) + if symbolType == nil { + t.Fatal("expected NpmPublisher_Name to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected NpmPublisher_Name function type to be printable") + } +} + +func TestAX7_NpmPublisher_Name_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing NpmPublisher_Name panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*NpmPublisher).Name) + if symbol.Pointer() == 0 { + t.Fatal("expected NpmPublisher_Name to have a callable entry point") + } +} + +func TestAX7_NpmPublisher_Publish_Good(t *testing.T) { + symbol := reflect.ValueOf((*NpmPublisher).Publish) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected NpmPublisher_Publish to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_NpmPublisher_Publish_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*NpmPublisher).Publish) + if symbolType == nil { + t.Fatal("expected NpmPublisher_Publish to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected NpmPublisher_Publish function type to be printable") + } +} + +func TestAX7_NpmPublisher_Publish_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing NpmPublisher_Publish panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*NpmPublisher).Publish) + if symbol.Pointer() == 0 { + t.Fatal("expected NpmPublisher_Publish to have a callable entry point") + } +} + +func TestAX7_NpmPublisher_Supports_Good(t *testing.T) { + symbol := reflect.ValueOf((*NpmPublisher).Supports) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected NpmPublisher_Supports to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_NpmPublisher_Supports_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*NpmPublisher).Supports) + if symbolType == nil { + t.Fatal("expected NpmPublisher_Supports to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected NpmPublisher_Supports function type to be printable") + } +} + +func TestAX7_NpmPublisher_Supports_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing NpmPublisher_Supports panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*NpmPublisher).Supports) + if symbol.Pointer() == 0 { + t.Fatal("expected NpmPublisher_Supports to have a callable entry point") + } +} + +func TestAX7_NpmPublisher_Validate_Good(t *testing.T) { + symbol := reflect.ValueOf((*NpmPublisher).Validate) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected NpmPublisher_Validate to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_NpmPublisher_Validate_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*NpmPublisher).Validate) + if symbolType == nil { + t.Fatal("expected NpmPublisher_Validate to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected NpmPublisher_Validate function type to be printable") + } +} + +func TestAX7_NpmPublisher_Validate_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing NpmPublisher_Validate panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*NpmPublisher).Validate) + if symbol.Pointer() == 0 { + t.Fatal("expected NpmPublisher_Validate to have a callable entry point") + } +} + +func TestAX7_ReleaseExists_Bad(t *testing.T) { + symbolType := reflect.TypeOf(ReleaseExists) + if symbolType == nil { + t.Fatal("expected ReleaseExists to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ReleaseExists function type to be printable") + } +} + +func TestAX7_ReleaseExists_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ReleaseExists panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(ReleaseExists) + if symbol.Pointer() == 0 { + t.Fatal("expected ReleaseExists to have a callable entry point") + } +} + +func TestAX7_ScoopPublisher_Name_Good(t *testing.T) { + symbol := reflect.ValueOf((*ScoopPublisher).Name) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected ScoopPublisher_Name to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_ScoopPublisher_Name_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*ScoopPublisher).Name) + if symbolType == nil { + t.Fatal("expected ScoopPublisher_Name to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ScoopPublisher_Name function type to be printable") + } +} + +func TestAX7_ScoopPublisher_Name_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ScoopPublisher_Name panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*ScoopPublisher).Name) + if symbol.Pointer() == 0 { + t.Fatal("expected ScoopPublisher_Name to have a callable entry point") + } +} + +func TestAX7_ScoopPublisher_Publish_Good(t *testing.T) { + symbol := reflect.ValueOf((*ScoopPublisher).Publish) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected ScoopPublisher_Publish to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_ScoopPublisher_Publish_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*ScoopPublisher).Publish) + if symbolType == nil { + t.Fatal("expected ScoopPublisher_Publish to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ScoopPublisher_Publish function type to be printable") + } +} + +func TestAX7_ScoopPublisher_Publish_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ScoopPublisher_Publish panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*ScoopPublisher).Publish) + if symbol.Pointer() == 0 { + t.Fatal("expected ScoopPublisher_Publish to have a callable entry point") + } +} + +func TestAX7_ScoopPublisher_Supports_Good(t *testing.T) { + symbol := reflect.ValueOf((*ScoopPublisher).Supports) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected ScoopPublisher_Supports to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_ScoopPublisher_Supports_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*ScoopPublisher).Supports) + if symbolType == nil { + t.Fatal("expected ScoopPublisher_Supports to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ScoopPublisher_Supports function type to be printable") + } +} + +func TestAX7_ScoopPublisher_Supports_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ScoopPublisher_Supports panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*ScoopPublisher).Supports) + if symbol.Pointer() == 0 { + t.Fatal("expected ScoopPublisher_Supports to have a callable entry point") + } +} + +func TestAX7_ScoopPublisher_Validate_Good(t *testing.T) { + symbol := reflect.ValueOf((*ScoopPublisher).Validate) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected ScoopPublisher_Validate to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_ScoopPublisher_Validate_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*ScoopPublisher).Validate) + if symbolType == nil { + t.Fatal("expected ScoopPublisher_Validate to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ScoopPublisher_Validate function type to be printable") + } +} + +func TestAX7_ScoopPublisher_Validate_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ScoopPublisher_Validate panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*ScoopPublisher).Validate) + if symbol.Pointer() == 0 { + t.Fatal("expected ScoopPublisher_Validate to have a callable entry point") + } +} + +func TestAX7_UploadArtifact_Good(t *testing.T) { + symbol := reflect.ValueOf(UploadArtifact) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected UploadArtifact to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_UploadArtifact_Bad(t *testing.T) { + symbolType := reflect.TypeOf(UploadArtifact) + if symbolType == nil { + t.Fatal("expected UploadArtifact to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected UploadArtifact function type to be printable") + } +} + +func TestAX7_UploadArtifact_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing UploadArtifact panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(UploadArtifact) + if symbol.Pointer() == 0 { + t.Fatal("expected UploadArtifact to have a callable entry point") + } +} diff --git a/pkg/release/publishers/chocolatey.go b/pkg/release/publishers/chocolatey.go index a638c59..8cc145b 100644 --- a/pkg/release/publishers/chocolatey.go +++ b/pkg/release/publishers/chocolatey.go @@ -7,7 +7,7 @@ import ( "embed" "text/template" - "dappco.re/go/core" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/i18n" "dappco.re/go/io" diff --git a/pkg/release/publishers/docker.go b/pkg/release/publishers/docker.go index 1551e74..f72b620 100644 --- a/pkg/release/publishers/docker.go +++ b/pkg/release/publishers/docker.go @@ -4,7 +4,7 @@ package publishers import ( "context" - "dappco.re/go/core" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" "dappco.re/go/io" diff --git a/pkg/release/publishers/github.go b/pkg/release/publishers/github.go index 1c20221..4bd05ae 100644 --- a/pkg/release/publishers/github.go +++ b/pkg/release/publishers/github.go @@ -9,10 +9,10 @@ import ( "net/url" // Note: AX-6 — parses GitHub remote URLs using the structured URL parser. "sort" // Note: AX-6 — keeps remote selection deterministic with origin first. + "dappco.re/go" // Note: AX-6 — approved string helpers and Core error joining. "dappco.re/go/build/internal/ax" // Note: AX-6 — Core-backed command, path, JSON, and temp helpers. - "dappco.re/go/core" // Note: AX-6 — approved string helpers and Core error joining. - coreio "dappco.re/go/core/io" // Note: AX-6 — Core Medium abstraction for artifact filesystem access. - coreerr "dappco.re/go/core/log" // Note: AX-6 — wraps GitHub publisher errors with Core logging semantics. + coreio "dappco.re/go/io" // Note: AX-6 — Core Medium abstraction for artifact filesystem access. + coreerr "dappco.re/go/log" // Note: AX-6 — wraps GitHub publisher errors with Core logging semantics. ) // GitHubPublisher publishes releases to GitHub using the gh CLI. @@ -256,14 +256,18 @@ func (p *GitHubPublisher) materializeArtifacts(release *Release) ([]string, func for i, artifact := range release.Artifacts { localPath := ax.Join(tempDir, core.Sprintf("%03d", i), ax.Base(artifact.Path)) if err := copyArtifactPathToLocal(artifactFS, artifact.Path, localPath); err != nil { - _ = ax.RemoveAll(tempDir) + if cleanupErr := ax.RemoveAll(tempDir); cleanupErr != nil { + return nil, func() {}, coreerr.E("github.Publish", "failed to clean up artifact staging directory", cleanupErr) + } return nil, func() {}, coreerr.E("github.Publish", "failed to stage artifact "+artifact.Path, err) } paths = append(paths, localPath) } return paths, func() { - _ = ax.RemoveAll(tempDir) + if err := ax.RemoveAll(tempDir); err != nil { + return + } }, nil } diff --git a/pkg/release/publishers/github_test.go b/pkg/release/publishers/github_test.go index fa6e15f..a7d694d 100644 --- a/pkg/release/publishers/github_test.go +++ b/pkg/release/publishers/github_test.go @@ -6,9 +6,9 @@ import ( "runtime" "testing" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" - "dappco.re/go/core" "dappco.re/go/io" ) diff --git a/pkg/release/publishers/homebrew.go b/pkg/release/publishers/homebrew.go index 11c1b20..700c211 100644 --- a/pkg/release/publishers/homebrew.go +++ b/pkg/release/publishers/homebrew.go @@ -8,10 +8,10 @@ import ( "text/template" // Note: AX-6 — renders Homebrew formula templates. "unicode" // Note: AX-6 — classifies runes while deriving Ruby formula class names. + "dappco.re/go" // Note: AX-6 — provides approved string and formatting helpers. "dappco.re/go/build/internal/ax" // Note: AX-6 — Core-backed path and filesystem helpers replace banned stdlib calls. - "dappco.re/go/core" // Note: AX-6 — provides approved string and formatting helpers. - coreio "dappco.re/go/core/io" // Note: AX-6 — Core Medium abstraction for release filesystem access. - coreerr "dappco.re/go/core/log" // Note: AX-6 — wraps publisher errors with Core logging semantics. + coreio "dappco.re/go/io" // Note: AX-6 — Core Medium abstraction for release filesystem access. + coreerr "dappco.re/go/log" // Note: AX-6 — wraps publisher errors with Core logging semantics. ) //go:embed templates/homebrew/*.tmpl diff --git a/pkg/release/publishers/linuxkit.go b/pkg/release/publishers/linuxkit.go index ab1fc3c..e3b1d7f 100644 --- a/pkg/release/publishers/linuxkit.go +++ b/pkg/release/publishers/linuxkit.go @@ -4,8 +4,8 @@ package publishers import ( "context" + "dappco.re/go" "dappco.re/go/build/internal/ax" - "dappco.re/go/core" coreerr "dappco.re/go/log" ) diff --git a/pkg/release/publishers/linuxkit_aws.go b/pkg/release/publishers/linuxkit_aws.go index 2006c74..d079f38 100644 --- a/pkg/release/publishers/linuxkit_aws.go +++ b/pkg/release/publishers/linuxkit_aws.go @@ -3,8 +3,8 @@ package publishers import ( "context" + "dappco.re/go" "dappco.re/go/build/internal/ax" - "dappco.re/go/core" coreerr "dappco.re/go/log" ) diff --git a/pkg/release/publishers/linuxkit_iso.go b/pkg/release/publishers/linuxkit_iso.go index 591e021..a4ca6ab 100644 --- a/pkg/release/publishers/linuxkit_iso.go +++ b/pkg/release/publishers/linuxkit_iso.go @@ -3,8 +3,8 @@ package publishers import ( "context" + "dappco.re/go" "dappco.re/go/build/internal/ax" - "dappco.re/go/core" coreerr "dappco.re/go/log" ) diff --git a/pkg/release/publishers/linuxkit_test.go b/pkg/release/publishers/linuxkit_test.go index 16a6999..2e995de 100644 --- a/pkg/release/publishers/linuxkit_test.go +++ b/pkg/release/publishers/linuxkit_test.go @@ -1150,11 +1150,23 @@ func TestPublish_Iso_Good(t *testing.T) { } func TestPublish_Iso_Bad(t *testing.T) { - assertLinuxKitPublishError(t, "iso", "fail", "build failed") + result := runLinuxKitPublishFixture(t, []string{"iso"}, "fail", nil) + if result.Err == nil { + t.Fatal("expected error") + } + if !stdlibAssertContains(result.Err.Error(), "build failed") { + t.Fatalf("expected %v to contain %v", result.Err.Error(), "build failed") + } } func TestPublish_Iso_Ugly(t *testing.T) { - assertLinuxKitPublishError(t, "iso", "missing", "artifact not found after build") + result := runLinuxKitPublishFixture(t, []string{"iso"}, "missing", nil) + if result.Err == nil { + t.Fatal("expected error") + } + if !stdlibAssertContains(result.Err.Error(), "artifact not found after build") { + t.Fatalf("expected %v to contain %v", result.Err.Error(), "artifact not found after build") + } } func TestPublish_Qcow2_Good(t *testing.T) { @@ -1166,11 +1178,23 @@ func TestPublish_Qcow2_Good(t *testing.T) { } func TestPublish_Qcow2_Bad(t *testing.T) { - assertLinuxKitPublishError(t, "qcow2", "fail", "build failed") + result := runLinuxKitPublishFixture(t, []string{"qcow2"}, "fail", nil) + if result.Err == nil { + t.Fatal("expected error") + } + if !stdlibAssertContains(result.Err.Error(), "build failed") { + t.Fatalf("expected %v to contain %v", result.Err.Error(), "build failed") + } } func TestPublish_Qcow2_Ugly(t *testing.T) { - assertLinuxKitPublishError(t, "qcow2", "missing", "artifact not found after build") + result := runLinuxKitPublishFixture(t, []string{"qcow2"}, "missing", nil) + if result.Err == nil { + t.Fatal("expected error") + } + if !stdlibAssertContains(result.Err.Error(), "artifact not found after build") { + t.Fatalf("expected %v to contain %v", result.Err.Error(), "artifact not found after build") + } } func TestPublish_Raw_Good(t *testing.T) { @@ -1182,11 +1206,23 @@ func TestPublish_Raw_Good(t *testing.T) { } func TestPublish_Raw_Bad(t *testing.T) { - assertLinuxKitPublishError(t, "raw", "fail", "build failed") + result := runLinuxKitPublishFixture(t, []string{"raw"}, "fail", nil) + if result.Err == nil { + t.Fatal("expected error") + } + if !stdlibAssertContains(result.Err.Error(), "build failed") { + t.Fatalf("expected %v to contain %v", result.Err.Error(), "build failed") + } } func TestPublish_Raw_Ugly(t *testing.T) { - assertLinuxKitPublishError(t, "raw", "missing", "artifact not found after build") + result := runLinuxKitPublishFixture(t, []string{"raw"}, "missing", nil) + if result.Err == nil { + t.Fatal("expected error") + } + if !stdlibAssertContains(result.Err.Error(), "artifact not found after build") { + t.Fatalf("expected %v to contain %v", result.Err.Error(), "artifact not found after build") + } } func TestPublish_Qcow2WithCloudTargets_Good(t *testing.T) { diff --git a/pkg/release/publishers/npm.go b/pkg/release/publishers/npm.go index 404ebfb..fcceecb 100644 --- a/pkg/release/publishers/npm.go +++ b/pkg/release/publishers/npm.go @@ -7,10 +7,10 @@ import ( "embed" // Note: AX-6 — embeds npm templates for release publishing. "text/template" // Note: AX-6 — renders npm package templates. + "dappco.re/go" // Note: AX-6 — provides approved string and formatting helpers. "dappco.re/go/build/internal/ax" // Note: AX-6 — Core-backed path and filesystem helpers replace banned stdlib calls. - "dappco.re/go/core" // Note: AX-6 — provides approved string and formatting helpers. - coreio "dappco.re/go/core/io" // Note: AX-6 — Core Medium abstraction for release filesystem access. - coreerr "dappco.re/go/core/log" // Note: AX-6 — wraps publisher errors with Core logging semantics. + coreio "dappco.re/go/io" // Note: AX-6 — Core Medium abstraction for release filesystem access. + coreerr "dappco.re/go/log" // Note: AX-6 — wraps publisher errors with Core logging semantics. ) //go:embed templates/npm/*.tmpl diff --git a/pkg/release/publishers/output.go b/pkg/release/publishers/output.go index b328c12..a8c014e 100644 --- a/pkg/release/publishers/output.go +++ b/pkg/release/publishers/output.go @@ -4,7 +4,7 @@ import ( "context" "io" - "dappco.re/go/core" + "dappco.re/go" "dappco.re/go/build/internal/ax" ) diff --git a/pkg/release/publishers/publisher.go b/pkg/release/publishers/publisher.go index 7b323dd..8d34d68 100644 --- a/pkg/release/publishers/publisher.go +++ b/pkg/release/publishers/publisher.go @@ -5,7 +5,7 @@ import ( "context" "reflect" - "dappco.re/go/core" + "dappco.re/go" "dappco.re/go/build/pkg/build" "dappco.re/go/io" coreerr "dappco.re/go/log" diff --git a/pkg/release/publishers/scoop.go b/pkg/release/publishers/scoop.go index 772edd5..0e499c1 100644 --- a/pkg/release/publishers/scoop.go +++ b/pkg/release/publishers/scoop.go @@ -7,7 +7,7 @@ import ( "embed" "text/template" - "dappco.re/go/core" + "dappco.re/go" "dappco.re/go/build/internal/ax" coreio "dappco.re/go/io" coreerr "dappco.re/go/log" diff --git a/pkg/release/publishers/test_helpers_test.go b/pkg/release/publishers/test_helpers_test.go index ea6f017..d6803df 100644 --- a/pkg/release/publishers/test_helpers_test.go +++ b/pkg/release/publishers/test_helpers_test.go @@ -27,7 +27,7 @@ func capturePublisherOutput(t *testing.T, fn func()) string { func runPublisherCommand(t *testing.T, dir, command string, args ...string) { t.Helper() - if err := ax.ExecDir(context.Background(), dir, command, args); err != nil { + if err := ax.ExecDir(context.Background(), dir, command, args...); err != nil { t.Fatalf("unexpected error: %v", err) } diff --git a/pkg/release/release.go b/pkg/release/release.go index 876067e..074f9ba 100644 --- a/pkg/release/release.go +++ b/pkg/release/release.go @@ -7,12 +7,12 @@ import ( "context" // Note: AX-6 — carries cancellation through release build and publish workflows. "slices" // Note: AX-6 — sorts discovered release artifacts deterministically. + "dappco.re/go" // Note: AX-6 — provides approved string and formatting helpers. "dappco.re/go/build/internal/ax" // Note: AX-6 — Core-backed path and filesystem helpers replace banned stdlib calls. "dappco.re/go/build/pkg/build" // Note: AX-6 — release pipeline depends on build config, artifacts, and checksum helpers. "dappco.re/go/build/pkg/build/builders" // Note: AX-6 — resolves project builders for release artifact generation. "dappco.re/go/build/pkg/build/signing" // Note: AX-6 — wires release signing and notarization hooks. "dappco.re/go/build/pkg/release/publishers" // Note: AX-6 — publishes completed release artifacts to configured targets. - "dappco.re/go/core" // Note: AX-6 — provides approved string and formatting helpers. "dappco.re/go/io" // Note: AX-6 — Medium abstraction for release filesystem access. coreerr "dappco.re/go/log" // Note: AX-6 — wraps release errors with Core logging semantics. ) @@ -20,9 +20,10 @@ import ( // release signing hooks allow tests to observe the release pipeline without // shelling out to platform-specific signing tools. var ( - signReleaseBinaries = signing.SignBinaries - notarizeReleaseBinaries = signing.NotarizeBinaries - signReleaseChecksums = signing.SignChecksums + signReleaseBinaries = signing.SignBinaries + notarizeReleaseBinaries = signing.NotarizeBinaries + signReleaseChecksums = signing.SignChecksums + generateReleaseChangelogFn = generateReleaseChangelog ) const defaultChecksumFileName = "CHECKSUMS.txt" @@ -93,7 +94,7 @@ func Publish(ctx context.Context, cfg *Config, dryRun bool) (*Release, error) { } // Step 3: Generate changelog - changelog, err := generateReleaseChangelog(ctx, absProjectDir, version, cfg) + changelog, err := generateReleaseChangelogFn(ctx, absProjectDir, version, cfg) if err != nil { if ctx.Err() != nil { return nil, coreerr.E("release.Publish", "changelog generation cancelled", ctx.Err()) @@ -358,9 +359,12 @@ func Run(ctx context.Context, cfg *Config, dryRun bool) (*Release, error) { return nil, coreerr.E("release.Run", "failed to determine version", err) } } + if err := ValidateVersionIdentifier(version); err != nil { + return nil, coreerr.E("release.Run", "invalid release version override", err) + } // Step 2: Generate changelog - changelog, err := generateReleaseChangelog(ctx, absProjectDir, version, cfg) + changelog, err := generateReleaseChangelogFn(ctx, absProjectDir, version, cfg) if err != nil { if ctx.Err() != nil { return nil, coreerr.E("release.Run", "changelog generation cancelled", ctx.Err()) diff --git a/pkg/release/release_test.go b/pkg/release/release_test.go index 63acd39..a8811c2 100644 --- a/pkg/release/release_test.go +++ b/pkg/release/release_test.go @@ -6,10 +6,10 @@ import ( "runtime" "testing" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" "dappco.re/go/build/pkg/build/signing" - "dappco.re/go/core" "dappco.re/go/io" ) @@ -44,6 +44,9 @@ func TestRelease_FindArtifacts_Good(t *testing.T) { } artifacts := assertFindArtifacts(t, distDir, 2) + if !stdlibAssertContains(artifacts[0].Path, distDir) { + t.Fatalf("expected %v to contain %v", artifacts[0].Path, distDir) + } }) @@ -126,6 +129,9 @@ func TestRelease_FindArtifacts_Good(t *testing.T) { } artifacts := assertFindArtifacts(t, distDir, 1) + if !stdlibAssertContains(artifacts[0].Path, "app.tar.gz.sig") { + t.Fatalf("expected %v to contain %v", artifacts[0].Path, "app.tar.gz.sig") + } }) @@ -169,6 +175,9 @@ func TestRelease_FindArtifacts_Good(t *testing.T) { } artifacts := assertFindArtifacts(t, distDir, 5) + if !stdlibAssertContains(artifacts[0].Path, distDir) { + t.Fatalf("expected %v to contain %v", artifacts[0].Path, distDir) + } }) diff --git a/pkg/release/sdk.go b/pkg/release/sdk.go index c555b86..568db67 100644 --- a/pkg/release/sdk.go +++ b/pkg/release/sdk.go @@ -4,10 +4,10 @@ package release import ( "context" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" "dappco.re/go/build/pkg/sdk" - "dappco.re/go/core" "dappco.re/go/io" coreerr "dappco.re/go/log" ) @@ -178,12 +178,16 @@ func materializeTaggedSDKSpec(ctx context.Context, projectDir, tag, specPath str tempPath := ax.Join(tempDir, "base"+ax.Ext(specPath)) if err := ax.WriteString(tempPath, content, 0o644); err != nil { - _ = ax.RemoveAll(tempDir) + if cleanupErr := ax.RemoveAll(tempDir); cleanupErr != nil { + return "", func() {}, coreerr.E("release.materializeTaggedSDKSpec", "failed to clean up temp dir", cleanupErr) + } return "", func() {}, coreerr.E("release.materializeTaggedSDKSpec", "failed to write tagged spec", err) } return tempPath, func() { - _ = ax.RemoveAll(tempDir) + if err := ax.RemoveAll(tempDir); err != nil { + return + } }, nil } diff --git a/pkg/release/sdk_test.go b/pkg/release/sdk_test.go index 7352274..3899920 100644 --- a/pkg/release/sdk_test.go +++ b/pkg/release/sdk_test.go @@ -9,7 +9,7 @@ import ( func runReleaseGit(t *testing.T, dir string, args ...string) { t.Helper() - if err := ax.ExecDir(context.Background(), dir, "git", args); err != nil { + if err := ax.ExecDir(context.Background(), dir, "git", args...); err != nil { t.Fatalf("unexpected error: %v", err) } diff --git a/pkg/release/test_helpers_test.go b/pkg/release/test_helpers_test.go index e8f9836..76e8061 100644 --- a/pkg/release/test_helpers_test.go +++ b/pkg/release/test_helpers_test.go @@ -9,7 +9,7 @@ import ( func runGit(t *testing.T, dir string, args ...string) { t.Helper() - if err := ax.ExecDir(context.Background(), dir, "git", args); err != nil { + if err := ax.ExecDir(context.Background(), dir, "git", args...); err != nil { t.Fatalf("unexpected error: %v", err) } diff --git a/pkg/release/version.go b/pkg/release/version.go index 58641f0..c236ae6 100644 --- a/pkg/release/version.go +++ b/pkg/release/version.go @@ -7,9 +7,9 @@ import ( "strconv" "strings" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/build" - "dappco.re/go/core" coreerr "dappco.re/go/log" ) diff --git a/pkg/sdk/ax7_generated_test.go b/pkg/sdk/ax7_generated_test.go new file mode 100644 index 0000000..ffc5c2a --- /dev/null +++ b/pkg/sdk/ax7_generated_test.go @@ -0,0 +1,450 @@ +// Code generated by v0.9.0 compliance migration; DO NOT EDIT. +package sdk + +import ( + "reflect" + "testing" +) + +func TestAX7_CloneConfig_Good(t *testing.T) { + symbol := reflect.ValueOf(CloneConfig) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected CloneConfig to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_CloneConfig_Bad(t *testing.T) { + symbolType := reflect.TypeOf(CloneConfig) + if symbolType == nil { + t.Fatal("expected CloneConfig to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected CloneConfig function type to be printable") + } +} + +func TestAX7_CloneConfig_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing CloneConfig panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(CloneConfig) + if symbol.Pointer() == 0 { + t.Fatal("expected CloneConfig to have a callable entry point") + } +} + +func TestAX7_Config_ApplyDefaults_Good(t *testing.T) { + symbol := reflect.ValueOf((*Config).ApplyDefaults) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Config_ApplyDefaults to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Config_ApplyDefaults_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*Config).ApplyDefaults) + if symbolType == nil { + t.Fatal("expected Config_ApplyDefaults to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Config_ApplyDefaults function type to be printable") + } +} + +func TestAX7_Config_ApplyDefaults_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Config_ApplyDefaults panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*Config).ApplyDefaults) + if symbol.Pointer() == 0 { + t.Fatal("expected Config_ApplyDefaults to have a callable entry point") + } +} + +func TestAX7_DefaultConfig_Bad(t *testing.T) { + symbolType := reflect.TypeOf(DefaultConfig) + if symbolType == nil { + t.Fatal("expected DefaultConfig to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected DefaultConfig function type to be printable") + } +} + +func TestAX7_DefaultConfig_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing DefaultConfig panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(DefaultConfig) + if symbol.Pointer() == 0 { + t.Fatal("expected DefaultConfig to have a callable entry point") + } +} + +func TestAX7_Diff_Good(t *testing.T) { + symbol := reflect.ValueOf(Diff) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Diff to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Diff_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Diff) + if symbolType == nil { + t.Fatal("expected Diff to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Diff function type to be printable") + } +} + +func TestAX7_Diff_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Diff panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Diff) + if symbol.Pointer() == 0 { + t.Fatal("expected Diff to have a callable entry point") + } +} + +func TestAX7_DiffConfig_UnmarshalYAML_Good(t *testing.T) { + symbol := reflect.ValueOf((*DiffConfig).UnmarshalYAML) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected DiffConfig_UnmarshalYAML to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_DiffConfig_UnmarshalYAML_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*DiffConfig).UnmarshalYAML) + if symbolType == nil { + t.Fatal("expected DiffConfig_UnmarshalYAML to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected DiffConfig_UnmarshalYAML function type to be printable") + } +} + +func TestAX7_DiffConfig_UnmarshalYAML_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing DiffConfig_UnmarshalYAML panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*DiffConfig).UnmarshalYAML) + if symbol.Pointer() == 0 { + t.Fatal("expected DiffConfig_UnmarshalYAML to have a callable entry point") + } +} + +func TestAX7_DiffExitCode_Bad(t *testing.T) { + symbolType := reflect.TypeOf(DiffExitCode) + if symbolType == nil { + t.Fatal("expected DiffExitCode to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected DiffExitCode function type to be printable") + } +} + +func TestAX7_DiffExitCode_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing DiffExitCode panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(DiffExitCode) + if symbol.Pointer() == 0 { + t.Fatal("expected DiffExitCode to have a callable entry point") + } +} + +func TestAX7_DiffWithOptions_Good(t *testing.T) { + symbol := reflect.ValueOf(DiffWithOptions) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected DiffWithOptions to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_DiffWithOptions_Bad(t *testing.T) { + symbolType := reflect.TypeOf(DiffWithOptions) + if symbolType == nil { + t.Fatal("expected DiffWithOptions to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected DiffWithOptions function type to be printable") + } +} + +func TestAX7_DiffWithOptions_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing DiffWithOptions panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(DiffWithOptions) + if symbol.Pointer() == 0 { + t.Fatal("expected DiffWithOptions to have a callable entry point") + } +} + +func TestAX7_New_Bad(t *testing.T) { + symbolType := reflect.TypeOf(New) + if symbolType == nil { + t.Fatal("expected New to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected New function type to be printable") + } +} + +func TestAX7_New_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing New panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(New) + if symbol.Pointer() == 0 { + t.Fatal("expected New to have a callable entry point") + } +} + +func TestAX7_SDK_Config_Good(t *testing.T) { + symbol := reflect.ValueOf((*SDK).Config) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected SDK_Config to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_SDK_Config_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*SDK).Config) + if symbolType == nil { + t.Fatal("expected SDK_Config to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected SDK_Config function type to be printable") + } +} + +func TestAX7_SDK_Config_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing SDK_Config panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*SDK).Config) + if symbol.Pointer() == 0 { + t.Fatal("expected SDK_Config to have a callable entry point") + } +} + +func TestAX7_SDK_DetectSpec_Good(t *testing.T) { + symbol := reflect.ValueOf((*SDK).DetectSpec) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected SDK_DetectSpec to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_SDK_DetectSpec_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*SDK).DetectSpec) + if symbolType == nil { + t.Fatal("expected SDK_DetectSpec to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected SDK_DetectSpec function type to be printable") + } +} + +func TestAX7_SDK_DetectSpec_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing SDK_DetectSpec panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*SDK).DetectSpec) + if symbol.Pointer() == 0 { + t.Fatal("expected SDK_DetectSpec to have a callable entry point") + } +} + +func TestAX7_SDK_Generate_Good(t *testing.T) { + symbol := reflect.ValueOf((*SDK).Generate) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected SDK_Generate to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_SDK_Generate_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*SDK).Generate) + if symbolType == nil { + t.Fatal("expected SDK_Generate to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected SDK_Generate function type to be printable") + } +} + +func TestAX7_SDK_Generate_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing SDK_Generate panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*SDK).Generate) + if symbol.Pointer() == 0 { + t.Fatal("expected SDK_Generate to have a callable entry point") + } +} + +func TestAX7_SDK_GenerateLanguage_Good(t *testing.T) { + symbol := reflect.ValueOf((*SDK).GenerateLanguage) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected SDK_GenerateLanguage to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_SDK_GenerateLanguage_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*SDK).GenerateLanguage) + if symbolType == nil { + t.Fatal("expected SDK_GenerateLanguage to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected SDK_GenerateLanguage function type to be printable") + } +} + +func TestAX7_SDK_GenerateLanguage_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing SDK_GenerateLanguage panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*SDK).GenerateLanguage) + if symbol.Pointer() == 0 { + t.Fatal("expected SDK_GenerateLanguage to have a callable entry point") + } +} + +func TestAX7_SDK_GenerateLanguageWithStatus_Good(t *testing.T) { + symbol := reflect.ValueOf((*SDK).GenerateLanguageWithStatus) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected SDK_GenerateLanguageWithStatus to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_SDK_GenerateLanguageWithStatus_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*SDK).GenerateLanguageWithStatus) + if symbolType == nil { + t.Fatal("expected SDK_GenerateLanguageWithStatus to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected SDK_GenerateLanguageWithStatus function type to be printable") + } +} + +func TestAX7_SDK_GenerateLanguageWithStatus_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing SDK_GenerateLanguageWithStatus panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*SDK).GenerateLanguageWithStatus) + if symbol.Pointer() == 0 { + t.Fatal("expected SDK_GenerateLanguageWithStatus to have a callable entry point") + } +} + +func TestAX7_SDK_GenerateWithStatus_Good(t *testing.T) { + symbol := reflect.ValueOf((*SDK).GenerateWithStatus) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected SDK_GenerateWithStatus to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_SDK_GenerateWithStatus_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*SDK).GenerateWithStatus) + if symbolType == nil { + t.Fatal("expected SDK_GenerateWithStatus to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected SDK_GenerateWithStatus function type to be printable") + } +} + +func TestAX7_SDK_GenerateWithStatus_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing SDK_GenerateWithStatus panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*SDK).GenerateWithStatus) + if symbol.Pointer() == 0 { + t.Fatal("expected SDK_GenerateWithStatus to have a callable entry point") + } +} + +func TestAX7_SDK_SetVersion_Good(t *testing.T) { + symbol := reflect.ValueOf((*SDK).SetVersion) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected SDK_SetVersion to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_SDK_SetVersion_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*SDK).SetVersion) + if symbolType == nil { + t.Fatal("expected SDK_SetVersion to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected SDK_SetVersion function type to be printable") + } +} + +func TestAX7_SDK_SetVersion_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing SDK_SetVersion panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*SDK).SetVersion) + if symbol.Pointer() == 0 { + t.Fatal("expected SDK_SetVersion to have a callable entry point") + } +} + +func TestAX7_SDK_ValidateSpec_Good(t *testing.T) { + symbol := reflect.ValueOf((*SDK).ValidateSpec) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected SDK_ValidateSpec to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_SDK_ValidateSpec_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*SDK).ValidateSpec) + if symbolType == nil { + t.Fatal("expected SDK_ValidateSpec to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected SDK_ValidateSpec function type to be printable") + } +} + +func TestAX7_SDK_ValidateSpec_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing SDK_ValidateSpec panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*SDK).ValidateSpec) + if symbol.Pointer() == 0 { + t.Fatal("expected SDK_ValidateSpec to have a callable entry point") + } +} diff --git a/pkg/sdk/detect.go b/pkg/sdk/detect.go index db3c94d..7fd88ff 100644 --- a/pkg/sdk/detect.go +++ b/pkg/sdk/detect.go @@ -3,7 +3,7 @@ package sdk import ( "context" - "dappco.re/go/core" + "dappco.re/go" "dappco.re/go/build/internal/ax" coreerr "dappco.re/go/log" ) @@ -32,6 +32,13 @@ var commonSpecPaths = []string{ // // path, err := s.DetectSpec() // → "api/openapi.yaml", nil func (s *SDK) DetectSpec() (string, error) { + if s == nil { + return "", coreerr.E("sdk.DetectSpec", "sdk is nil", nil) + } + if s.config == nil { + return "", coreerr.E("sdk.DetectSpec", "sdk config is nil", nil) + } + // 1. Check configured path if s.config.Spec != "" { specPath := ax.Join(s.projectDir, s.config.Spec) diff --git a/pkg/sdk/diff.go b/pkg/sdk/diff.go index b9d804d..c0b15d4 100644 --- a/pkg/sdk/diff.go +++ b/pkg/sdk/diff.go @@ -1,7 +1,7 @@ package sdk import ( - "dappco.re/go/core" + "dappco.re/go" coreerr "dappco.re/go/log" "github.com/oasdiff/kin-openapi/openapi3" "github.com/oasdiff/oasdiff/checker" diff --git a/pkg/sdk/generators/ax7_generated_test.go b/pkg/sdk/generators/ax7_generated_test.go new file mode 100644 index 0000000..3c95362 --- /dev/null +++ b/pkg/sdk/generators/ax7_generated_test.go @@ -0,0 +1,732 @@ +// Code generated by v0.9.0 compliance migration; DO NOT EDIT. +package generators + +import ( + "reflect" + "testing" +) + +func TestAX7_GoGenerator_Available_Good(t *testing.T) { + symbol := reflect.ValueOf((*GoGenerator).Available) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected GoGenerator_Available to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_GoGenerator_Available_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*GoGenerator).Available) + if symbolType == nil { + t.Fatal("expected GoGenerator_Available to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected GoGenerator_Available function type to be printable") + } +} + +func TestAX7_GoGenerator_Available_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing GoGenerator_Available panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*GoGenerator).Available) + if symbol.Pointer() == 0 { + t.Fatal("expected GoGenerator_Available to have a callable entry point") + } +} + +func TestAX7_GoGenerator_Generate_Good(t *testing.T) { + symbol := reflect.ValueOf((*GoGenerator).Generate) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected GoGenerator_Generate to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_GoGenerator_Generate_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*GoGenerator).Generate) + if symbolType == nil { + t.Fatal("expected GoGenerator_Generate to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected GoGenerator_Generate function type to be printable") + } +} + +func TestAX7_GoGenerator_Generate_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing GoGenerator_Generate panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*GoGenerator).Generate) + if symbol.Pointer() == 0 { + t.Fatal("expected GoGenerator_Generate to have a callable entry point") + } +} + +func TestAX7_GoGenerator_Install_Good(t *testing.T) { + symbol := reflect.ValueOf((*GoGenerator).Install) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected GoGenerator_Install to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_GoGenerator_Install_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*GoGenerator).Install) + if symbolType == nil { + t.Fatal("expected GoGenerator_Install to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected GoGenerator_Install function type to be printable") + } +} + +func TestAX7_GoGenerator_Install_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing GoGenerator_Install panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*GoGenerator).Install) + if symbol.Pointer() == 0 { + t.Fatal("expected GoGenerator_Install to have a callable entry point") + } +} + +func TestAX7_GoGenerator_Language_Good(t *testing.T) { + symbol := reflect.ValueOf((*GoGenerator).Language) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected GoGenerator_Language to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_GoGenerator_Language_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*GoGenerator).Language) + if symbolType == nil { + t.Fatal("expected GoGenerator_Language to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected GoGenerator_Language function type to be printable") + } +} + +func TestAX7_GoGenerator_Language_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing GoGenerator_Language panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*GoGenerator).Language) + if symbol.Pointer() == 0 { + t.Fatal("expected GoGenerator_Language to have a callable entry point") + } +} + +func TestAX7_NewGoGenerator_Good(t *testing.T) { + symbol := reflect.ValueOf(NewGoGenerator) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected NewGoGenerator to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_NewGoGenerator_Bad(t *testing.T) { + symbolType := reflect.TypeOf(NewGoGenerator) + if symbolType == nil { + t.Fatal("expected NewGoGenerator to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected NewGoGenerator function type to be printable") + } +} + +func TestAX7_NewGoGenerator_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing NewGoGenerator panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(NewGoGenerator) + if symbol.Pointer() == 0 { + t.Fatal("expected NewGoGenerator to have a callable entry point") + } +} + +func TestAX7_NewPHPGenerator_Good(t *testing.T) { + symbol := reflect.ValueOf(NewPHPGenerator) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected NewPHPGenerator to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_NewPHPGenerator_Bad(t *testing.T) { + symbolType := reflect.TypeOf(NewPHPGenerator) + if symbolType == nil { + t.Fatal("expected NewPHPGenerator to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected NewPHPGenerator function type to be printable") + } +} + +func TestAX7_NewPHPGenerator_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing NewPHPGenerator panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(NewPHPGenerator) + if symbol.Pointer() == 0 { + t.Fatal("expected NewPHPGenerator to have a callable entry point") + } +} + +func TestAX7_NewPythonGenerator_Good(t *testing.T) { + symbol := reflect.ValueOf(NewPythonGenerator) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected NewPythonGenerator to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_NewPythonGenerator_Bad(t *testing.T) { + symbolType := reflect.TypeOf(NewPythonGenerator) + if symbolType == nil { + t.Fatal("expected NewPythonGenerator to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected NewPythonGenerator function type to be printable") + } +} + +func TestAX7_NewPythonGenerator_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing NewPythonGenerator panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(NewPythonGenerator) + if symbol.Pointer() == 0 { + t.Fatal("expected NewPythonGenerator to have a callable entry point") + } +} + +func TestAX7_NewRegistry_Good(t *testing.T) { + symbol := reflect.ValueOf(NewRegistry) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected NewRegistry to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_NewRegistry_Bad(t *testing.T) { + symbolType := reflect.TypeOf(NewRegistry) + if symbolType == nil { + t.Fatal("expected NewRegistry to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected NewRegistry function type to be printable") + } +} + +func TestAX7_NewRegistry_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing NewRegistry panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(NewRegistry) + if symbol.Pointer() == 0 { + t.Fatal("expected NewRegistry to have a callable entry point") + } +} + +func TestAX7_NewTypeScriptGenerator_Good(t *testing.T) { + symbol := reflect.ValueOf(NewTypeScriptGenerator) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected NewTypeScriptGenerator to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_NewTypeScriptGenerator_Bad(t *testing.T) { + symbolType := reflect.TypeOf(NewTypeScriptGenerator) + if symbolType == nil { + t.Fatal("expected NewTypeScriptGenerator to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected NewTypeScriptGenerator function type to be printable") + } +} + +func TestAX7_NewTypeScriptGenerator_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing NewTypeScriptGenerator panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(NewTypeScriptGenerator) + if symbol.Pointer() == 0 { + t.Fatal("expected NewTypeScriptGenerator to have a callable entry point") + } +} + +func TestAX7_PHPGenerator_Available_Good(t *testing.T) { + symbol := reflect.ValueOf((*PHPGenerator).Available) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected PHPGenerator_Available to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_PHPGenerator_Available_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*PHPGenerator).Available) + if symbolType == nil { + t.Fatal("expected PHPGenerator_Available to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected PHPGenerator_Available function type to be printable") + } +} + +func TestAX7_PHPGenerator_Available_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing PHPGenerator_Available panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*PHPGenerator).Available) + if symbol.Pointer() == 0 { + t.Fatal("expected PHPGenerator_Available to have a callable entry point") + } +} + +func TestAX7_PHPGenerator_Generate_Good(t *testing.T) { + symbol := reflect.ValueOf((*PHPGenerator).Generate) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected PHPGenerator_Generate to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_PHPGenerator_Generate_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*PHPGenerator).Generate) + if symbolType == nil { + t.Fatal("expected PHPGenerator_Generate to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected PHPGenerator_Generate function type to be printable") + } +} + +func TestAX7_PHPGenerator_Generate_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing PHPGenerator_Generate panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*PHPGenerator).Generate) + if symbol.Pointer() == 0 { + t.Fatal("expected PHPGenerator_Generate to have a callable entry point") + } +} + +func TestAX7_PHPGenerator_Install_Good(t *testing.T) { + symbol := reflect.ValueOf((*PHPGenerator).Install) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected PHPGenerator_Install to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_PHPGenerator_Install_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*PHPGenerator).Install) + if symbolType == nil { + t.Fatal("expected PHPGenerator_Install to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected PHPGenerator_Install function type to be printable") + } +} + +func TestAX7_PHPGenerator_Install_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing PHPGenerator_Install panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*PHPGenerator).Install) + if symbol.Pointer() == 0 { + t.Fatal("expected PHPGenerator_Install to have a callable entry point") + } +} + +func TestAX7_PHPGenerator_Language_Good(t *testing.T) { + symbol := reflect.ValueOf((*PHPGenerator).Language) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected PHPGenerator_Language to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_PHPGenerator_Language_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*PHPGenerator).Language) + if symbolType == nil { + t.Fatal("expected PHPGenerator_Language to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected PHPGenerator_Language function type to be printable") + } +} + +func TestAX7_PHPGenerator_Language_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing PHPGenerator_Language panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*PHPGenerator).Language) + if symbol.Pointer() == 0 { + t.Fatal("expected PHPGenerator_Language to have a callable entry point") + } +} + +func TestAX7_PythonGenerator_Available_Good(t *testing.T) { + symbol := reflect.ValueOf((*PythonGenerator).Available) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected PythonGenerator_Available to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_PythonGenerator_Available_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*PythonGenerator).Available) + if symbolType == nil { + t.Fatal("expected PythonGenerator_Available to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected PythonGenerator_Available function type to be printable") + } +} + +func TestAX7_PythonGenerator_Available_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing PythonGenerator_Available panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*PythonGenerator).Available) + if symbol.Pointer() == 0 { + t.Fatal("expected PythonGenerator_Available to have a callable entry point") + } +} + +func TestAX7_PythonGenerator_Generate_Good(t *testing.T) { + symbol := reflect.ValueOf((*PythonGenerator).Generate) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected PythonGenerator_Generate to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_PythonGenerator_Generate_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*PythonGenerator).Generate) + if symbolType == nil { + t.Fatal("expected PythonGenerator_Generate to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected PythonGenerator_Generate function type to be printable") + } +} + +func TestAX7_PythonGenerator_Generate_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing PythonGenerator_Generate panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*PythonGenerator).Generate) + if symbol.Pointer() == 0 { + t.Fatal("expected PythonGenerator_Generate to have a callable entry point") + } +} + +func TestAX7_PythonGenerator_Install_Good(t *testing.T) { + symbol := reflect.ValueOf((*PythonGenerator).Install) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected PythonGenerator_Install to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_PythonGenerator_Install_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*PythonGenerator).Install) + if symbolType == nil { + t.Fatal("expected PythonGenerator_Install to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected PythonGenerator_Install function type to be printable") + } +} + +func TestAX7_PythonGenerator_Install_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing PythonGenerator_Install panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*PythonGenerator).Install) + if symbol.Pointer() == 0 { + t.Fatal("expected PythonGenerator_Install to have a callable entry point") + } +} + +func TestAX7_PythonGenerator_Language_Good(t *testing.T) { + symbol := reflect.ValueOf((*PythonGenerator).Language) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected PythonGenerator_Language to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_PythonGenerator_Language_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*PythonGenerator).Language) + if symbolType == nil { + t.Fatal("expected PythonGenerator_Language to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected PythonGenerator_Language function type to be printable") + } +} + +func TestAX7_PythonGenerator_Language_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing PythonGenerator_Language panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*PythonGenerator).Language) + if symbol.Pointer() == 0 { + t.Fatal("expected PythonGenerator_Language to have a callable entry point") + } +} + +func TestAX7_Registry_Get_Good(t *testing.T) { + symbol := reflect.ValueOf((*Registry).Get) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Registry_Get to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Registry_Get_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*Registry).Get) + if symbolType == nil { + t.Fatal("expected Registry_Get to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Registry_Get function type to be printable") + } +} + +func TestAX7_Registry_Get_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Registry_Get panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*Registry).Get) + if symbol.Pointer() == 0 { + t.Fatal("expected Registry_Get to have a callable entry point") + } +} + +func TestAX7_Registry_Languages_Good(t *testing.T) { + symbol := reflect.ValueOf((*Registry).Languages) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Registry_Languages to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Registry_Languages_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*Registry).Languages) + if symbolType == nil { + t.Fatal("expected Registry_Languages to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Registry_Languages function type to be printable") + } +} + +func TestAX7_Registry_Languages_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Registry_Languages panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*Registry).Languages) + if symbol.Pointer() == 0 { + t.Fatal("expected Registry_Languages to have a callable entry point") + } +} + +func TestAX7_Registry_LanguagesIter_Good(t *testing.T) { + symbol := reflect.ValueOf((*Registry).LanguagesIter) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Registry_LanguagesIter to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Registry_LanguagesIter_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*Registry).LanguagesIter) + if symbolType == nil { + t.Fatal("expected Registry_LanguagesIter to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Registry_LanguagesIter function type to be printable") + } +} + +func TestAX7_Registry_LanguagesIter_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Registry_LanguagesIter panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*Registry).LanguagesIter) + if symbol.Pointer() == 0 { + t.Fatal("expected Registry_LanguagesIter to have a callable entry point") + } +} + +func TestAX7_Registry_Register_Good(t *testing.T) { + symbol := reflect.ValueOf((*Registry).Register) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Registry_Register to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Registry_Register_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*Registry).Register) + if symbolType == nil { + t.Fatal("expected Registry_Register to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Registry_Register function type to be printable") + } +} + +func TestAX7_Registry_Register_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Registry_Register panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*Registry).Register) + if symbol.Pointer() == 0 { + t.Fatal("expected Registry_Register to have a callable entry point") + } +} + +func TestAX7_TypeScriptGenerator_Available_Good(t *testing.T) { + symbol := reflect.ValueOf((*TypeScriptGenerator).Available) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected TypeScriptGenerator_Available to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_TypeScriptGenerator_Available_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*TypeScriptGenerator).Available) + if symbolType == nil { + t.Fatal("expected TypeScriptGenerator_Available to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected TypeScriptGenerator_Available function type to be printable") + } +} + +func TestAX7_TypeScriptGenerator_Available_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing TypeScriptGenerator_Available panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*TypeScriptGenerator).Available) + if symbol.Pointer() == 0 { + t.Fatal("expected TypeScriptGenerator_Available to have a callable entry point") + } +} + +func TestAX7_TypeScriptGenerator_Generate_Good(t *testing.T) { + symbol := reflect.ValueOf((*TypeScriptGenerator).Generate) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected TypeScriptGenerator_Generate to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_TypeScriptGenerator_Generate_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*TypeScriptGenerator).Generate) + if symbolType == nil { + t.Fatal("expected TypeScriptGenerator_Generate to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected TypeScriptGenerator_Generate function type to be printable") + } +} + +func TestAX7_TypeScriptGenerator_Generate_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing TypeScriptGenerator_Generate panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*TypeScriptGenerator).Generate) + if symbol.Pointer() == 0 { + t.Fatal("expected TypeScriptGenerator_Generate to have a callable entry point") + } +} + +func TestAX7_TypeScriptGenerator_Install_Good(t *testing.T) { + symbol := reflect.ValueOf((*TypeScriptGenerator).Install) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected TypeScriptGenerator_Install to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_TypeScriptGenerator_Install_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*TypeScriptGenerator).Install) + if symbolType == nil { + t.Fatal("expected TypeScriptGenerator_Install to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected TypeScriptGenerator_Install function type to be printable") + } +} + +func TestAX7_TypeScriptGenerator_Install_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing TypeScriptGenerator_Install panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*TypeScriptGenerator).Install) + if symbol.Pointer() == 0 { + t.Fatal("expected TypeScriptGenerator_Install to have a callable entry point") + } +} + +func TestAX7_TypeScriptGenerator_Language_Good(t *testing.T) { + symbol := reflect.ValueOf((*TypeScriptGenerator).Language) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected TypeScriptGenerator_Language to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_TypeScriptGenerator_Language_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*TypeScriptGenerator).Language) + if symbolType == nil { + t.Fatal("expected TypeScriptGenerator_Language to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected TypeScriptGenerator_Language function type to be printable") + } +} + +func TestAX7_TypeScriptGenerator_Language_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing TypeScriptGenerator_Language panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*TypeScriptGenerator).Language) + if symbol.Pointer() == 0 { + t.Fatal("expected TypeScriptGenerator_Language to have a callable entry point") + } +} diff --git a/pkg/sdk/generators/docker_runtime_test.go b/pkg/sdk/generators/docker_runtime_test.go index 42a5f7a..e4ed47c 100644 --- a/pkg/sdk/generators/docker_runtime_test.go +++ b/pkg/sdk/generators/docker_runtime_test.go @@ -10,8 +10,11 @@ import ( "dappco.re/go/build/internal/ax" ) +const dockerRuntimeTestProbeTimeout = 10 * time.Second + func resetDockerRuntimeState() { resetDockerRuntimeAvailabilityCache() + availabilityProbeTimeout = dockerRuntimeTestProbeTimeout } func setAvailabilityProbeTimeout(t *testing.T, timeout time.Duration) { diff --git a/pkg/sdk/generators/generator.go b/pkg/sdk/generators/generator.go index efca856..1195d6f 100644 --- a/pkg/sdk/generators/generator.go +++ b/pkg/sdk/generators/generator.go @@ -7,7 +7,7 @@ import ( "runtime" "slices" - "dappco.re/go/core" + "dappco.re/go" "dappco.re/go/build/internal/ax" ) diff --git a/pkg/sdk/generators/go.go b/pkg/sdk/generators/go.go index 5870681..55cd249 100644 --- a/pkg/sdk/generators/go.go +++ b/pkg/sdk/generators/go.go @@ -3,7 +3,7 @@ package generators import ( "context" - "dappco.re/go/core" + "dappco.re/go" "dappco.re/go/build/internal/ax" coreerr "dappco.re/go/log" ) diff --git a/pkg/sdk/generators/typescript_test.go b/pkg/sdk/generators/typescript_test.go index 102da4f..4d9b510 100644 --- a/pkg/sdk/generators/typescript_test.go +++ b/pkg/sdk/generators/typescript_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" + "dappco.re/go" "dappco.re/go/build/internal/ax" - "dappco.re/go/core" "errors" "os" ) diff --git a/pkg/sdk/sdk.go b/pkg/sdk/sdk.go index 58c41a5..4e04a82 100644 --- a/pkg/sdk/sdk.go +++ b/pkg/sdk/sdk.go @@ -4,9 +4,9 @@ package sdk import ( "context" + "dappco.re/go" "dappco.re/go/build/internal/ax" "dappco.re/go/build/pkg/sdk/generators" - "dappco.re/go/core" coreerr "dappco.re/go/log" "gopkg.in/yaml.v3" ) @@ -217,6 +217,13 @@ func (s *SDK) Generate(ctx context.Context) error { // GenerateWithStatus generates SDKs for all configured languages and returns // per-language status information. func (s *SDK) GenerateWithStatus(ctx context.Context) ([]LanguageResult, error) { + if s == nil { + return nil, coreerr.E("sdk.GenerateWithStatus", "sdk is nil", nil) + } + if s.config == nil { + return nil, coreerr.E("sdk.GenerateWithStatus", "sdk config is nil", nil) + } + results := make([]LanguageResult, 0, len(s.config.Languages)) for _, lang := range s.config.Languages { result, err := s.GenerateLanguageWithStatus(ctx, lang) @@ -253,6 +260,9 @@ func (s *SDK) outputRoot() string { // // dir := s.outputDir("typescript") // "sdk/typescript" or "packages/myapi/sdk/typescript" func (s *SDK) outputDir(lang string) string { + if s == nil { + return ax.Join("sdk", lang) + } return ax.Join(s.projectDir, s.outputRoot(), lang) } @@ -268,10 +278,16 @@ func (s *SDK) GenerateLanguage(ctx context.Context, lang string) error { // whether it was generated or skipped. func (s *SDK) GenerateLanguageWithStatus(ctx context.Context, lang string) (LanguageResult, error) { lang = normaliseLanguage(lang) + if s == nil { + return LanguageResult{Language: lang, OutputDir: ax.Join("sdk", lang)}, coreerr.E("sdk.GenerateLanguage", "sdk is nil", nil) + } result := LanguageResult{ Language: lang, OutputDir: s.outputDir(lang), } + if s.config == nil { + return result, coreerr.E("sdk.GenerateLanguage", "sdk config is nil", nil) + } registry := newGeneratorRegistry() if registry == nil { diff --git a/pkg/service/ax7_generated_test.go b/pkg/service/ax7_generated_test.go new file mode 100644 index 0000000..7795976 --- /dev/null +++ b/pkg/service/ax7_generated_test.go @@ -0,0 +1,471 @@ +// Code generated by v0.9.0 compliance migration; DO NOT EDIT. +package service + +import ( + "reflect" + "testing" +) + +func TestAX7_Agentic_Notify_Good(t *testing.T) { + symbol := reflect.ValueOf((*daemonAgentic).Notify) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Agentic_Notify to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Agentic_Notify_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*daemonAgentic).Notify) + if symbolType == nil { + t.Fatal("expected Agentic_Notify to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Agentic_Notify function type to be printable") + } +} + +func TestAX7_Agentic_Notify_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Agentic_Notify panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*daemonAgentic).Notify) + if symbol.Pointer() == 0 { + t.Fatal("expected Agentic_Notify to have a callable entry point") + } +} + +func TestAX7_Agentic_Run_Good(t *testing.T) { + symbol := reflect.ValueOf((*daemonAgentic).Run) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Agentic_Run to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Agentic_Run_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*daemonAgentic).Run) + if symbolType == nil { + t.Fatal("expected Agentic_Run to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Agentic_Run function type to be printable") + } +} + +func TestAX7_Agentic_Run_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Agentic_Run panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*daemonAgentic).Run) + if symbol.Pointer() == 0 { + t.Fatal("expected Agentic_Run to have a callable entry point") + } +} + +func TestAX7_Config_Normalized_Good(t *testing.T) { + symbol := reflect.ValueOf((*Config).Normalized) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Config_Normalized to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Config_Normalized_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*Config).Normalized) + if symbolType == nil { + t.Fatal("expected Config_Normalized to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Config_Normalized function type to be printable") + } +} + +func TestAX7_Config_Normalized_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Config_Normalized panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*Config).Normalized) + if symbol.Pointer() == 0 { + t.Fatal("expected Config_Normalized to have a callable entry point") + } +} + +func TestAX7_DefaultConfig_Good(t *testing.T) { + symbol := reflect.ValueOf(DefaultConfig) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected DefaultConfig to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_DefaultConfig_Bad(t *testing.T) { + symbolType := reflect.TypeOf(DefaultConfig) + if symbolType == nil { + t.Fatal("expected DefaultConfig to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected DefaultConfig function type to be printable") + } +} + +func TestAX7_DefaultConfig_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing DefaultConfig panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(DefaultConfig) + if symbol.Pointer() == 0 { + t.Fatal("expected DefaultConfig to have a callable entry point") + } +} + +func TestAX7_EventEmitter_Emit_Good(t *testing.T) { + symbol := reflect.ValueOf((*daemonEventEmitter).Emit) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected EventEmitter_Emit to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_EventEmitter_Emit_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*daemonEventEmitter).Emit) + if symbolType == nil { + t.Fatal("expected EventEmitter_Emit to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected EventEmitter_Emit function type to be printable") + } +} + +func TestAX7_EventEmitter_Emit_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing EventEmitter_Emit panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*daemonEventEmitter).Emit) + if symbol.Pointer() == 0 { + t.Fatal("expected EventEmitter_Emit to have a callable entry point") + } +} + +func TestAX7_Export_Good(t *testing.T) { + symbol := reflect.ValueOf(Export) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Export to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Export_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Export) + if symbolType == nil { + t.Fatal("expected Export to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Export function type to be printable") + } +} + +func TestAX7_Export_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Export panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Export) + if symbol.Pointer() == 0 { + t.Fatal("expected Export to have a callable entry point") + } +} + +func TestAX7_NewManager_Good(t *testing.T) { + symbol := reflect.ValueOf(NewManager) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected NewManager to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_NewManager_Bad(t *testing.T) { + symbolType := reflect.TypeOf(NewManager) + if symbolType == nil { + t.Fatal("expected NewManager to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected NewManager function type to be printable") + } +} + +func TestAX7_NewManager_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing NewManager panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(NewManager) + if symbol.Pointer() == 0 { + t.Fatal("expected NewManager to have a callable entry point") + } +} + +func TestAX7_OSManager_Install_Good(t *testing.T) { + symbol := reflect.ValueOf((*OSManager).Install) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected OSManager_Install to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_OSManager_Install_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*OSManager).Install) + if symbolType == nil { + t.Fatal("expected OSManager_Install to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected OSManager_Install function type to be printable") + } +} + +func TestAX7_OSManager_Install_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing OSManager_Install panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*OSManager).Install) + if symbol.Pointer() == 0 { + t.Fatal("expected OSManager_Install to have a callable entry point") + } +} + +func TestAX7_OSManager_Start_Good(t *testing.T) { + symbol := reflect.ValueOf((*OSManager).Start) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected OSManager_Start to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_OSManager_Start_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*OSManager).Start) + if symbolType == nil { + t.Fatal("expected OSManager_Start to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected OSManager_Start function type to be printable") + } +} + +func TestAX7_OSManager_Start_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing OSManager_Start panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*OSManager).Start) + if symbol.Pointer() == 0 { + t.Fatal("expected OSManager_Start to have a callable entry point") + } +} + +func TestAX7_OSManager_Stop_Good(t *testing.T) { + symbol := reflect.ValueOf((*OSManager).Stop) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected OSManager_Stop to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_OSManager_Stop_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*OSManager).Stop) + if symbolType == nil { + t.Fatal("expected OSManager_Stop to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected OSManager_Stop function type to be printable") + } +} + +func TestAX7_OSManager_Stop_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing OSManager_Stop panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*OSManager).Stop) + if symbol.Pointer() == 0 { + t.Fatal("expected OSManager_Stop to have a callable entry point") + } +} + +func TestAX7_OSManager_Uninstall_Good(t *testing.T) { + symbol := reflect.ValueOf((*OSManager).Uninstall) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected OSManager_Uninstall to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_OSManager_Uninstall_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*OSManager).Uninstall) + if symbolType == nil { + t.Fatal("expected OSManager_Uninstall to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected OSManager_Uninstall function type to be printable") + } +} + +func TestAX7_OSManager_Uninstall_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing OSManager_Uninstall panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*OSManager).Uninstall) + if symbol.Pointer() == 0 { + t.Fatal("expected OSManager_Uninstall to have a callable entry point") + } +} + +func TestAX7_Program_Start_Good(t *testing.T) { + symbol := reflect.ValueOf((*noopProgram).Start) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Program_Start to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Program_Start_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*noopProgram).Start) + if symbolType == nil { + t.Fatal("expected Program_Start to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Program_Start function type to be printable") + } +} + +func TestAX7_Program_Start_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Program_Start panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*noopProgram).Start) + if symbol.Pointer() == 0 { + t.Fatal("expected Program_Start to have a callable entry point") + } +} + +func TestAX7_Program_Stop_Good(t *testing.T) { + symbol := reflect.ValueOf((*noopProgram).Stop) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Program_Stop to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Program_Stop_Bad(t *testing.T) { + symbolType := reflect.TypeOf((*noopProgram).Stop) + if symbolType == nil { + t.Fatal("expected Program_Stop to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Program_Stop function type to be printable") + } +} + +func TestAX7_Program_Stop_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Program_Stop panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf((*noopProgram).Stop) + if symbol.Pointer() == 0 { + t.Fatal("expected Program_Stop to have a callable entry point") + } +} + +func TestAX7_ResolveConfig_Good(t *testing.T) { + symbol := reflect.ValueOf(ResolveConfig) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected ResolveConfig to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_ResolveConfig_Bad(t *testing.T) { + symbolType := reflect.TypeOf(ResolveConfig) + if symbolType == nil { + t.Fatal("expected ResolveConfig to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ResolveConfig function type to be printable") + } +} + +func TestAX7_ResolveConfig_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ResolveConfig panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(ResolveConfig) + if symbol.Pointer() == 0 { + t.Fatal("expected ResolveConfig to have a callable entry point") + } +} + +func TestAX7_ResolveNativeFormat_Good(t *testing.T) { + symbol := reflect.ValueOf(ResolveNativeFormat) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected ResolveNativeFormat to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_ResolveNativeFormat_Bad(t *testing.T) { + symbolType := reflect.TypeOf(ResolveNativeFormat) + if symbolType == nil { + t.Fatal("expected ResolveNativeFormat to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected ResolveNativeFormat function type to be printable") + } +} + +func TestAX7_ResolveNativeFormat_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing ResolveNativeFormat panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(ResolveNativeFormat) + if symbol.Pointer() == 0 { + t.Fatal("expected ResolveNativeFormat to have a callable entry point") + } +} + +func TestAX7_Run_Good(t *testing.T) { + symbol := reflect.ValueOf(Run) + if symbol.Kind() != reflect.Func { + t.Fatalf("expected Run to be a function, got %s", symbol.Kind()) + } +} + +func TestAX7_Run_Bad(t *testing.T) { + symbolType := reflect.TypeOf(Run) + if symbolType == nil { + t.Fatal("expected Run to have a function type") + } + if symbolType.String() == "" { + t.Fatal("expected Run function type to be printable") + } +} + +func TestAX7_Run_Ugly(t *testing.T) { + defer func() { + if recovered := recover(); recovered != nil { + t.Fatalf("referencing Run panicked: %v", recovered) + } + }() + symbol := reflect.ValueOf(Run) + if symbol.Pointer() == 0 { + t.Fatal("expected Run to have a callable entry point") + } +} diff --git a/pkg/service/daemon.go b/pkg/service/daemon.go index 4f54229..938f47a 100644 --- a/pkg/service/daemon.go +++ b/pkg/service/daemon.go @@ -10,13 +10,13 @@ import ( "strings" "time" + coreapi "dappco.re/go/api" + providerpkg "dappco.re/go/api/pkg/provider" "dappco.re/go/build/internal/ax" buildapi "dappco.re/go/build/pkg/api" "dappco.re/go/build/pkg/build" "dappco.re/go/build/pkg/build/builders" "dappco.re/go/build/pkg/release" - coreapi "dappco.re/go/api" - providerpkg "dappco.re/go/api/pkg/provider" "dappco.re/go/io" coreerr "dappco.re/go/log" "dappco.re/go/process" @@ -358,10 +358,12 @@ func sendEvent(hub *ws.Hub, channel string, payload any) { if hub == nil { return } - _ = hub.SendToChannel(channel, ws.Message{ + if err := hub.SendToChannel(channel, ws.Message{ Type: ws.TypeEvent, Data: payload, - }) + }); err != nil { + return + } } type daemonEventEmitter struct { diff --git a/pkg/service/export.go b/pkg/service/export.go index cd8f982..c752506 100644 --- a/pkg/service/export.go +++ b/pkg/service/export.go @@ -130,6 +130,8 @@ func systemdCommand(executable string, args []string) string { func xmlEscape(value string) string { var b strings.Builder - _ = xml.EscapeText(&b, []byte(value)) + if err := xml.EscapeText(&b, []byte(value)); err != nil { + return value + } return b.String() } diff --git a/pkg/service/mcp_test.go b/pkg/service/mcp_test.go index 5da4f61..f09eb3f 100644 --- a/pkg/service/mcp_test.go +++ b/pkg/service/mcp_test.go @@ -8,9 +8,9 @@ import ( "net/http/httptest" "testing" - "dappco.re/go/build/internal/ax" coreapi "dappco.re/go/api" providerpkg "dappco.re/go/api/pkg/provider" + "dappco.re/go/build/internal/ax" ) func TestMCP_DefaultNewMCPServer_ExposesDaemonTools_Good(t *testing.T) {