Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
name: Test
strategy:
matrix:
go-version: [ '1.23', '1.24', '1.25' ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Verify dependencies
run: go mod verify

- name: Run go vet
run: go vet ./...

- name: Run tests
run: go test -v -race -coverprofile=coverage.out ./...

- name: Upload coverage
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.25'
uses: codecov/codecov-action@v4
with:
file: ./coverage.out
continue-on-error: true

lint:
name: Lint
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: latest

benchmark:
name: Benchmark
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'

- name: Run benchmarks
run: go test -bench=. -benchmem -run=^$
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release

on:
push:
branches:
- master

permissions:
contents: write
pull-requests: write

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'

- name: Run tests
run: go test -v -race ./...

- name: Create release
uses: googleapis/release-please-action@v4
id: release
with:
release-type: go
package-name: gotree
token: ${{ secrets.GITHUB_TOKEN }}

- name: Tag major and minor versions
if: ${{ steps.release.outputs.release_created }}
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
git tag -d v${{ steps.release.outputs.major }} 2>/dev/null || true
git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} 2>/dev/null || true
git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}"
git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}"
git push origin v${{ steps.release.outputs.major }} --force
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} --force
19 changes: 19 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
linters:
enable:
- gofmt
- govet
- staticcheck
- ineffassign
- misspell
- unconvert
- unparam
- unused
- errcheck
- gosimple

linters-settings:
govet:
check-shadowing: true

issues:
exclude-use-default: false
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# DEPRECATED: This project has migrated to GitHub Actions
# See .github/workflows/ci.yml for current CI configuration
# This file is kept for historical reference only

language: go
go_import_path: github.com/disiqueira/gotree
git:
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changelog

## [3.0.3](https://github.com/d6o/GoTree/compare/v3.0.2...v3.0.3) (2026-02-03)


### Bug Fixes

* Correct the spelling in README.md ([07d11ce](https://github.com/d6o/GoTree/commit/07d11ce3f54daaa88bd9a492a4010e8c500bcc69))
* Correct the spelling in README.md ([8656016](https://github.com/d6o/GoTree/commit/86560162b85f6c59ead96268465bf9611920644d))
38 changes: 38 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.PHONY: test bench lint fmt vet coverage clean help

# Default target
help:
@echo "GoTree Makefile"
@echo ""
@echo "Available targets:"
@echo " make test - Run all tests"
@echo " make bench - Run benchmarks"
@echo " make lint - Run linter"
@echo " make fmt - Format code"
@echo " make vet - Run go vet"
@echo " make coverage - Generate coverage report"
@echo " make clean - Clean build artifacts"

test:
go test -v -race ./...

bench:
go test -bench=. -benchmem -run=^$$

lint:
golangci-lint run

fmt:
go fmt ./...

vet:
go vet ./...

coverage:
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
@echo "Coverage report generated: coverage.html"

clean:
rm -f coverage.out coverage.html
go clean -testcache
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ![GoTree](https://rawgit.com/DiSiqueira/GoTree/master/gotree-logo.png)
# ![GoTree](https://raw.githubusercontent.com/d6o/GoTree/master/gotree-logo.png)

# GoTree ![Language Badge](https://img.shields.io/badge/Language-Go-blue.svg) ![Go Report](https://goreportcard.com/badge/github.com/DiSiqueira/GoTree) ![License Badge](https://img.shields.io/badge/License-MIT-blue.svg) ![Status Badge](https://img.shields.io/badge/Status-Beta-brightgreen.svg) [![GoDoc](https://godoc.org/github.com/DiSiqueira/GoTree?status.svg)](https://godoc.org/github.com/DiSiqueira/GoTree) [![Build Status](https://travis-ci.org/DiSiqueira/GoTree.svg?branch=master)](https://travis-ci.org/DiSiqueira/GoTree)
# GoTree ![Language Badge](https://img.shields.io/badge/Language-Go-blue.svg) ![Go Report](https://goreportcard.com/badge/github.com/d6o/GoTree) ![License Badge](https://img.shields.io/badge/License-MIT-blue.svg) ![Status Badge](https://img.shields.io/badge/Status-Beta-brightgreen.svg) [![GoDoc](https://godoc.org/github.com/d6o/GoTree?status.svg)](https://godoc.org/github.com/d6o/GoTree) [![CI](https://github.com/d6o/GoTree/workflows/CI/badge.svg)](https://github.com/d6o/GoTree/actions)

Simple Go module to print tree structures in terminal. Heavily inspired by [The Tree Command for Linux][treecommand]

Expand All @@ -10,7 +10,7 @@ The GoTree's goal is to be a simple tool providing a stupidly easy-to-use and fa

## Project Status

GoTree is on beta. Pull Requests [are welcome](https://github.com/DiSiqueira/GoTree#social-coding)
GoTree is on beta. Pull Requests [are welcome](https://github.com/d6o/GoTree#social-coding)

![](http://image.prntscr.com/image/2a0dbf0777454446b8083fb6a0dc51fe.png)

Expand All @@ -20,14 +20,14 @@ GoTree is on beta. Pull Requests [are welcome](https://github.com/DiSiqueira/GoT
- Intuitive names
- Easy to extend
- Uses only native libs
- STUPIDLY [EASY TO USE](https://github.com/DiSiqueira/GoTree#usage)
- STUPIDLY [EASY TO USE](https://github.com/d6o/GoTree#usage)

## Installation

### Go Get

```bash
$ go get github.com/disiqueira/gotree
$ go get github.com/d6o/gotree
```

## Usage
Expand All @@ -42,7 +42,7 @@ package main
import (
"fmt"

"github.com/disiqueira/gotree"
"github.com/d6o/gotree"
)

func main() {
Expand All @@ -58,21 +58,21 @@ func main() {

### Bug Reports & Feature Requests

Please use the [issue tracker](https://github.com/DiSiqueira/GoTree/issues) to report any bugs or file feature requests.
Please use the [issue tracker](https://github.com/d6o/GoTree/issues) to report any bugs or file feature requests.

### Developing

PRs are welcome. To begin developing, do this:

```bash
$ git clone --recursive git@github.com:DiSiqueira/GoTree.git
$ git clone --recursive git@github.com:d6o/GoTree.git
$ cd GoTree/
```

## Social Coding

1. Create an issue to discuss about your idea
2. [Fork it] (https://github.com/DiSiqueira/GoTree/fork)
2. [Fork it] (https://github.com/d6o/GoTree/fork)
3. Create your feature branch (`git checkout -b my-new-feature`)
4. Commit your changes (`git commit -am 'Add some feature'`)
5. Push to the branch (`git push origin my-new-feature`)
Expand Down
31 changes: 31 additions & 0 deletions coverage.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
mode: atomic
github.com/disiqueira/gotree/v3/gotree.go:43.28,48.2 1 145
github.com/disiqueira/gotree/v3/gotree.go:53.38,57.2 3 119
github.com/disiqueira/gotree/v3/gotree.go:61.35,62.17 1 3
github.com/disiqueira/gotree/v3/gotree.go:62.17,64.3 1 1
github.com/disiqueira/gotree/v3/gotree.go:65.2,65.33 1 2
github.com/disiqueira/gotree/v3/gotree.go:69.30,71.2 1 147
github.com/disiqueira/gotree/v3/gotree.go:74.31,76.2 1 238
github.com/disiqueira/gotree/v3/gotree.go:79.31,81.2 1 6
github.com/disiqueira/gotree/v3/gotree.go:83.27,85.2 1 6
github.com/disiqueira/gotree/v3/gotree.go:88.40,97.2 6 6
github.com/disiqueira/gotree/v3/gotree.go:99.75,107.31 3 117
github.com/disiqueira/gotree/v3/gotree.go:107.31,108.12 1 4961
github.com/disiqueira/gotree/v3/gotree.go:108.12,110.4 1 4953
github.com/disiqueira/gotree/v3/gotree.go:110.9,112.4 1 8
github.com/disiqueira/gotree/v3/gotree.go:114.2,117.10 3 117
github.com/disiqueira/gotree/v3/gotree.go:117.10,119.3 1 108
github.com/disiqueira/gotree/v3/gotree.go:122.2,126.23 4 117
github.com/disiqueira/gotree/v3/gotree.go:126.23,128.13 2 122
github.com/disiqueira/gotree/v3/gotree.go:128.13,133.12 5 117
github.com/disiqueira/gotree/v3/gotree.go:135.3,135.11 1 5
github.com/disiqueira/gotree/v3/gotree.go:135.11,137.4 1 2
github.com/disiqueira/gotree/v3/gotree.go:137.9,139.4 1 3
github.com/disiqueira/gotree/v3/gotree.go:140.3,143.31 4 5
github.com/disiqueira/gotree/v3/gotree.go:146.2,146.25 1 117
github.com/disiqueira/gotree/v3/gotree.go:149.62,150.17 1 110
github.com/disiqueira/gotree/v3/gotree.go:150.17,152.3 1 2
github.com/disiqueira/gotree/v3/gotree.go:154.2,160.22 3 108
github.com/disiqueira/gotree/v3/gotree.go:160.22,163.25 3 117
github.com/disiqueira/gotree/v3/gotree.go:163.25,166.4 2 104
github.com/disiqueira/gotree/v3/gotree.go:168.2,168.25 1 108
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/disiqueira/gotree/v3
module github.com/d6o/gotree/v3

go 1.13
go 1.23
Loading