...

Package apidiff

import "golang.org/x/exp/apidiff"
Overview
Index

Overview ▾

type Change

A Change describes a single API change.

type Change struct {
    Message    string
    Compatible bool
}

type Module

Module is a convenience type for representing a Go module with a path and a slice of Packages contained within.

type Module struct {
    Path     string
    Packages []*types.Package
}

type Report

Report describes the changes detected by Changes.

type Report struct {
    Changes []Change
}

func Changes

func Changes(old, new *types.Package) Report

Changes reports on the differences between the APIs of the old and new packages. It classifies each difference as either compatible or incompatible (breaking.) For a detailed discussion of what constitutes an incompatible change, see the README.

func ModuleChanges

func ModuleChanges(old, new *Module) Report

ModuleChanges reports on the differences between the APIs of the old and new modules. It classifies each difference as either compatible or incompatible (breaking). This includes the addition and removal of entire packages. For a detailed discussion of what constitutes an incompatible change, see the README.

func (Report) String

func (r Report) String() string

func (Report) Text

func (r Report) Text(w io.Writer) error

func (Report) TextCompatible

func (r Report) TextCompatible(w io.Writer) error

func (Report) TextIncompatible

func (r Report) TextIncompatible(w io.Writer, withHeader bool) error