Documentation
¶
Overview ¶
Example ¶
package main
import (
"fmt"
"time"
"github.com/seiyab/akashi"
)
type User struct {
ID string
Name string
RegisteredAt time.Time
}
func main() {
s := akashi.DiffString(
User{
ID: "123",
Name: "Alice",
RegisteredAt: time.Date(2025, 2, 3, 23, 3, 15, 0, time.UTC),
},
User{
ID: "123",
Name: "Alice",
RegisteredAt: time.Date(2024, 12, 19, 5, 45, 50, 0, jst),
},
)
fmt.Println(s)
}
Output: akashi_test.User{ ID: "123", Name: "Alice", - RegisteredAt: time.Time("2025-02-03 23:03:15 +0000 UTC"), + RegisteredAt: time.Time("2024-12-19 05:45:50 +0900 JST"), }
Example (Slice) ¶
package main
import (
"fmt"
"github.com/seiyab/akashi"
)
func main() {
s := akashi.DiffString(
[]string{"a", "b", "c", "d"},
[]string{"a", "c", "d", "e"},
)
fmt.Println(s)
}
Output: []string{ "a", - "b", "c", "d", + "e", }
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiffString ¶
DiffString returns a string that represents the difference between x and y.
Types ¶
type Option ¶
type Option func(*differ) *differ
Option is an option for DiffString.
func WithFormat ¶
func WithFormat(fn interface{}) Option
WithFormat sets a function to format a value.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.