Skip to content

Releases: ddddddO/gtree

v1.11.8

04 Aug 09:16
3c587f0
Compare
Choose a tag to compare

What's Changed

  • Bump github.com/goccy/go-yaml from 1.17.1 to 1.18.0 by @dependabot[bot] in #317
  • Bump golang.org/x/sync from 0.14.0 to 0.15.0 by @dependabot[bot] in #318
  • Bump github.com/urfave/cli/v3 from 3.3.3 to 3.3.8 by @dependabot[bot] in #319
  • Bump golang.org/x/sync from 0.15.0 to 0.16.0 by @dependabot[bot] in #320

Full Changelog: v1.11.7...v1.11.8

v1.11.7

17 May 03:15
e27a480
Compare
Choose a tag to compare

What's Changed

  • Bump golang.org/x/sync from 0.13.0 to 0.14.0 by @dependabot in #315
  • Bump github.com/urfave/cli/v3 from 3.3.2 to 3.3.3 by @dependabot in #316
  • Add doc for custom writer

Full Changelog: v1.11.6...v1.11.7

v1.11.6

02 May 14:03
0d0e09d
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.11.5...v1.11.6

v1.11.5

25 Apr 16:15
8b7f8ff
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.11.4...v1.11.5

v1.11.4

20 Apr 08:37
c5a94c3
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.11.3...v1.11.4

v1.11.3

12 Apr 05:24
fa17ea9
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.11.2...v1.11.3

v1.11.2

05 Apr 00:58
cad061c
Compare
Choose a tag to compare

v1.11.1 change log

⚠ Marked some functions as deprecated in order to rename public functions. ⚠

v1.11.2 change log

v1.11.1

04 Apr 17:20
9dc644d
Compare
Choose a tag to compare

What's Changed

⚠ Marked some functions as deprecated in order to rename public functions. ⚠

Full Changelog: v1.11.0...v1.11.1

v1.11.0

28 Mar 16:39
2af19dd
Compare
Choose a tag to compare

What's Changed

  • WalkIterProgrammably func implemented by @ddddddO in #303
    • Iterator implementation
    • It returns each node resulting from a recursive traversal of the tree structure, so you can process on each node
    • 👇The following is sample code👇
package main

import (
	"fmt"
	"os"

	"github.com/ddddddO/gtree"
)

func main() {
	root := gtree.NewRoot("root")
	root.Add("child 1").Add("child 2").Add("child 3")
	root.Add("child 5")
	root.Add("child 1").Add("child 2").Add("child 4")

	for wn, err := range gtree.WalkIterProgrammably(root) {
		if err != nil {
			fmt.Fprintln(os.Stderr, err)
			os.Exit(1)
		}

		fmt.Println(wn.Row())
	}
	// Output:
	// root
	// ├── child 1
	// │   └── child 2
	// │       ├── child 3
	// │       └── child 4
	// └── child 5


	for wn, err := range gtree.WalkIterProgrammably(root) {
		if err != nil {
			fmt.Fprintln(os.Stderr, err)
			os.Exit(1)
		}

		fmt.Println("WalkerNode's methods called...")
		fmt.Printf("\tName     : %s\n", wn.Name())
		fmt.Printf("\tBranch   : %s\n", wn.Branch())
		fmt.Printf("\tRow      : %s\n", wn.Row())
		fmt.Printf("\tLevel    : %d\n", wn.Level())
		fmt.Printf("\tPath     : %s\n", wn.Path())
		fmt.Printf("\tHasChild : %t\n", wn.HasChild())
	}
	// Output:
	// WalkerNode's methods called...
	//         Name     : root
	//         Branch   : 
	//         Row      : root
	//         Level    : 1
	//         Path     : root
	//         HasChild : true
	// WalkerNode's methods called...
	//         Name     : child 1
	//         Branch   : ├──
	//         Row      : ├── child 1
	//         Level    : 2
	//         Path     : root/child 1
	//         HasChild : true
	// WalkerNode's methods called...
	//         Name     : child 2
	//         Branch   : │   └──
	//         Row      : │   └── child 2
	//         Level    : 3
	//         Path     : root/child 1/child 2
	//         HasChild : true
	// WalkerNode's methods called...
	//         Name     : child 3
	//         Branch   : │       ├──
	//         Row      : │       ├── child 3
	//         Level    : 4
	//         Path     : root/child 1/child 2/child 3
	//         HasChild : false
	// WalkerNode's methods called...
	//         Name     : child 4
	//         Branch   : │       └──
	//         Row      : │       └── child 4
	//         Level    : 4
	//         Path     : root/child 1/child 2/child 4
	//         HasChild : false
	// WalkerNode's methods called...
	//         Name     : child 5
	//         Branch   : └──
	//         Row      : └── child 5
	//         Level    : 2
	//         Path     : root/child 5
	//         HasChild : false
}

Full Changelog: v1.10.15...v1.11.0

v1.10.15

16 Mar 11:03
918fc8c
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.10.14...v1.10.15