Go / Source merge

Go Module Merge

This page has a stable URL for review, documentation, and implementation comparison. The fixture tabs show merge inputs and output; the contract tabs show JSON and compact ruleset renderings with stable IDs and deterministic ownership.

Basic .go mergegotop_level_declarationsstructural_signaturenative_read_portable_writenormalize_tracked_layout_mergec_style_linego_declarations

Fixture sources

JSON fixture: structuredmerge-fixtures/go/slice-112-merge/module-merge.json

Compact ruleset: structuredmerge-fixtures/rulesets/go/slice-112-merge/module-merge.smrules

Fixture view
import "fmt"

func FormatName(name string) string {
  return name
}

func Greet(name string) string {
  return fmt.Sprint(FormatName(name))
}
Contract view
{
  "contract_id": "go-module-merge",
  "format": "go",
  "owners": "top_level_declarations",
  "match": "structural_signature",
  "read": "native_read_portable_write",
  "attach": "normalize_tracked_layout_merge",
  "comment_style": "c_style_line",
  "render": "go_declarations",
  "capabilities": {
    "imports_destination_wins": true
  }
}