Sample
github.com/imdario/mergo v0.3.8: ErrDifferentArgumentsTypes
Verified sample for golang github.com/imdario/mergo v0.3.8: ErrDifferentArgumentsTypes. The contract ran on go 1.26 · linux debian/x64 · docker and passed.
sha256:68a59e1e194cfbd7a09a6d0d0de9103db043007f1bbf16e3d0262343217a3447
This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured.
How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people.
MIT-0
Execution evidence
The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.
- Evidence basis
- Signed contract pass
- Verification receipts
- 1
- Signing keys that built it
- 1
Declared environment
linux 24 · ubuntu · glibc 2.39 x64 go
Verification-run environments
| Environment | Contract | Stages | Run |
|---|---|---|---|
| go 1.26 · linux debian/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · golang@1golang:1.26@sha256:e30143be198a… |
2026-09-06 |
Case
HOW- Goal
- verify github.com/imdario/mergo.ErrDifferentArgumentsTypes in pkg:golang/github.com/imdario/mergo@v0.3.8
- Packages
- Symbols
-
- github.com/imdario/mergo.ErrDifferentArgumentsTypes
- Created
- 2026-09-06T01:02:26Z
Contract
- mergo.Merge returns mergo.ErrDifferentArgumentsTypes when destination and source arguments are different struct types.
- mergo.Merge returns mergo.ErrDifferentArgumentsTypes when destination is a struct pointer and source is a primitive type.
- mergo.Merge returns mergo.ErrDifferentArgumentsTypes when destination and source maps have different value types.
- mergo.ErrDifferentArgumentsTypes error message equals "src and dst must be of same type".
Files
- PROMPT.md
- csx.json
- go.mod
- go.sum
- main.go
- spec.json
- test/contract_test.go
Source
Clean-room public code sample — generation instructions
Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.
A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.
Goal: verify github.com/imdario/mergo.ErrDifferentArgumentsTypes in pkg:golang/github.com/imdario/mergo@v0.3.8
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:golang/github.com/imdario/mergo@v0.3.8
Demonstrate these symbols/APIs:
- github.com/imdario/mergo.ErrDifferentArgumentsTypes
Rules:
- One focused purpose; the smallest project that proves the goal.
- Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
- Pin every dependency with a lockfile so resolution is reproducible.
- No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
- No personal names, emails, company names, or project identifiers of any kind.
- No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
- Keep it under 200 files and 256KB packed.
{"case":{"caseId":"case:sha256:6f0db9578aca12fcdf8a91b190c7ebe0bdc738ee15dc088fba3ce41c6eb9d65d","contract":["mergo.Merge returns mergo.ErrDifferentArgumentsTypes when destination and source arguments are different struct types.","mergo.Merge returns mergo.ErrDifferentArgumentsTypes when destination is a struct pointer and source is a primitive type.","mergo.Merge returns mergo.ErrDifferentArgumentsTypes when destination and source maps have different value types.","mergo.ErrDifferentArgumentsTypes error message equals \"src and dst must be of same type\"."],"goal":"verify github.com/imdario/mergo.ErrDifferentArgumentsTypes in pkg:golang/github.com/imdario/mergo@v0.3.8","kind":"HOW","packages":["pkg:golang/github.com/imdario/mergo@v0.3.8"],"schemaVersion":1,"symbols":["github.com/imdario/mergo.ErrDifferentArgumentsTypes"]},"contractCommand":["go","test","./..."],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"golang","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"go","schemaVersion":1},"license":"MIT-0","packages":["pkg:golang/github.com/imdario/mergo@v0.3.8"],"schemaVersion":1,"subject":"pkg:golang/github.com/imdario/mergo@v0.3.8","symbols":["github.com/imdario/mergo.ErrDifferentArgumentsTypes"],"verifierAdapter":"golang@1"}
module example.com/mergoerrdifferentargumentstypes
go 1.22
require (
github.com/imdario/mergo v0.3.8
gopkg.in/yaml.v2 v2.4.0 // indirect
)
github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ=
github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
package main
import (
"errors"
"fmt"
"github.com/imdario/mergo"
)
type ConfigA struct {
Host string
Port int
}
type ConfigB struct {
Endpoint string
Timeout int
}
func main() {
dst := ConfigA{Host: "localhost", Port: 8080}
src := ConfigB{Endpoint: "example.com", Timeout: 30}
err := mergo.Merge(&dst, src)
if errors.Is(err, mergo.ErrDifferentArgumentsTypes) || err == mergo.ErrDifferentArgumentsTypes {
fmt.Printf("Detected expected ErrDifferentArgumentsTypes: %v\n", err)
} else if err != nil {
fmt.Printf("Unexpected error: %v\n", err)
} else {
fmt.Println("Merge unexpectedly succeeded")
}
}
{
"schemaVersion": 1,
"goal": "verify github.com/imdario/mergo.ErrDifferentArgumentsTypes in pkg:golang/github.com/imdario/mergo@v0.3.8",
"kind": "HOW",
"packages": [
"pkg:golang/github.com/imdario/mergo@v0.3.8"
],
"symbols": [
"github.com/imdario/mergo.ErrDifferentArgumentsTypes"
]
}
package test
import (
"errors"
"testing"
"github.com/imdario/mergo"
)
type ServerConfig struct {
Host string
Port int
}
type ClientConfig struct {
Endpoint string
Timeout int
}
func TestErrDifferentArgumentsTypesWithDistinctStructs(t *testing.T) {
dst := ServerConfig{Host: "localhost", Port: 8080}
src := ClientConfig{Endpoint: "example.com", Timeout: 30}
err := mergo.Merge(&dst, src)
if err == nil {
t.Fatal("expected error when merging different struct types, got nil")
}
if !errors.Is(err, mergo.ErrDifferentArgumentsTypes) && err != mergo.ErrDifferentArgumentsTypes {
t.Fatalf("expected ErrDifferentArgumentsTypes, got: %v", err)
}
}
func TestErrDifferentArgumentsTypesWithStructAndPrimitive(t *testing.T) {
dst := ServerConfig{Host: "localhost", Port: 8080}
src := 42
err := mergo.Merge(&dst, src)
if err == nil {
t.Fatal("expected error when merging struct pointer with primitive, got nil")
}
if !errors.Is(err, mergo.ErrDifferentArgumentsTypes) && err != mergo.ErrDifferentArgumentsTypes {
t.Fatalf("expected ErrDifferentArgumentsTypes, got: %v", err)
}
}
func TestErrDifferentArgumentsTypesErrorMessage(t *testing.T) {
expectedMsg := "src and dst must be of same type"
if mergo.ErrDifferentArgumentsTypes.Error() != expectedMsg {
t.Fatalf("expected error message %q, got %q", expectedMsg, mergo.ErrDifferentArgumentsTypes.Error())
}
}
func TestErrDifferentArgumentsTypesWithDifferentMapValueTypes(t *testing.T) {
dst := map[string]int{"count": 1}
src := map[string]string{"name": "test"}
err := mergo.Merge(&dst, src)
if err == nil {
t.Fatal("expected error when merging maps of different types, got nil")
}
if !errors.Is(err, mergo.ErrDifferentArgumentsTypes) && err != mergo.ErrDifferentArgumentsTypes {
t.Fatalf("expected ErrDifferentArgumentsTypes, got: %v", err)
}
}
Origin Seeder
anonymous