Skip to content

Commit

Permalink
demo-jfrog-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
jedib0t committed Jan 4, 2024
1 parent be547fd commit abaa0e3
Show file tree
Hide file tree
Showing 5 changed files with 743 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
- run:
name: "Table-Demo"
command: "go run ./cmd/demo-table"
- run:
name: "Demo-JFrog-Utils"
command: "go run ./cmd/demo-jfrog-utils"

workflows:
# Below is the definition of your workflow.
Expand Down
32 changes: 32 additions & 0 deletions cmd/demo-jfrog-utils/demo.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package main

type Customer struct {
name string `col-name:"Name" auto-merge:"true"`
age string `col-name:"Age" auto-merge:"true"`
title string `col-name:"Product Title" auto-merge:"true"`
CatNumber string `col-name:"Product\nCatalog #" auto-merge:"true"`
Color string `col-name:"Color" extended:"true" auto-merge:"true"`
}

func main() {
customersSlice := []Customer{
{name: "Gai", age: "350", title: "SpiderFrog Shirt - Medium", CatNumber: "123456", Color: "Green"},
{name: "Gai", age: "350", title: "Floral Bottle", CatNumber: "147585", Color: "Blue"},
{name: "Noah", age: "21", title: "Pouch", CatNumber: "456789", Color: "Red"},
}

err := PrintTable(customersSlice, "Customers", "No customers were found", false)
if err != nil {
panic(err)
}

err = PrintTable(customersSlice, "Customers (extended=true)", "No customers were found", true)
if err != nil {
panic(err)
}

err = PrintTable([]Customer{}, "Customers (extended=true)", "No customers were found", true)
if err != nil {
panic(err)
}
}
Loading

0 comments on commit abaa0e3

Please sign in to comment.