{"modulePath":"github.com/aryann/difflib","version":"v0.0.0-20210328193216-ff5ff6dc229b","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package difflib\n\nPackage difflib provides functionality for computing the difference between two sequences of strings.\n\n## Functions\n\n```go\nfunc HTMLDiff(seq1, seq2 []string) string\n```\nHTMLDiff returns the results of diffing seq1 and seq2 as an HTML string. The resulting HTML is a table without the opening and closing table tags. Each table row represents a DiffRecord. The first and last columns contain the \"line numbers\" for seq1 and seq2, respectively (the function assumes that seq1 and seq2 represent the lines in a file). The second and third columns contain the actual file contents.\n\nThe cells that contain line numbers are decorated with the class \"line-num\". The cells that contain deleted elements are decorated with \"deleted\" and the cells that contain added elements are decorated with \"added\".\n\n## Types\n\n```go\ntype DeltaType int\n```\nDeltaType describes the relationship of elements in two sequences. The following table provides a summary:\n\n\t Constant    Code   Meaning\n\t----------  ------ ---------------------------------------\n\t Common      \" \"    The element occurs in both sequences.\n\t LeftOnly    \"-\"    The element is unique to sequence 1.\n\t RightOnly   \"+\"    The element is unique to sequence 2.\n\n```go\nconst (\n\tCommon DeltaType = iota\n\tLeftOnly\n\tRightOnly\n)\n```\n\n```go\nfunc (t DeltaType) String() string\n```\nString returns a string representation for DeltaType.\n\n```go\ntype DiffRecord struct {\n\tPayload string\n\tDelta   DeltaType\n}\n```\n\n```go\nfunc Diff(seq1, seq2 []string) (diff []DiffRecord)\n```\nDiff returns the result of diffing the seq1 and seq2.\n\n```go\nfunc (d DiffRecord) String() string\n```\nString returns a string representation of d. The string is a concatenation of the delta type and the payload.\n\n","path":"github.com/aryann/difflib","name":"difflib","synopsis":"Package difflib provides functionality for computing the difference between two sequences of strings.","isRedistributable":true}
