Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
yassinebenaid committed Feb 24, 2024
1 parent 73da22f commit e2ee155
Showing 1 changed file with 58 additions and 2 deletions.
60 changes: 58 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,66 @@
# godump
<div align="center">
<h1>godump</h1>
</div>

<div align="center">

[![Version](https://badge.fury.io/gh/yassinebenaid%2Fdotenv.svg)](https://badge.fury.io/gh/yassinebenaid%2Fdotenv)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENCE)

</div>

A simple GO library to dump any GO variable in a structured and colored way.

Useful during development when the standard `fmt` library doesn't help you extract arbitrary data.

## Example
## Get Started

Install the library:

```bash
go get -u github.com/yassinebenaid/godump
```

Then use the **Dump** function , you can pass any variable of any type:

```go
package main

import (
"github.com/yassinebenaid/godump"
)

func main() {
// String
var name = "yassinebenaid"
godump.Dump(name)

// Int
var num = 1234
godump.Dump(num)

// Slice
var slc = []int{1,2,3}
godump.Dump(slc)

// Map
var mp = map[int]string{1:"foo",2:"bar"}
godump.Dump(mp)

// Struct
var strct = struct{
Type string
Quantity float64
}{
"foo bar",
123.456
}
godump.Dump(strct)
}

```

# Demo

```go
package main
Expand Down

0 comments on commit e2ee155

Please sign in to comment.