Skip to content

Commit

Permalink
Merge pull request #92 from gotilty/feature/generic_refactor_files
Browse files Browse the repository at this point in the history
removed internal files into to main package & update docs
  • Loading branch information
hayrullahcansu authored Jul 4, 2022
2 parents 8874005 + e7ffa2c commit 617d0b4
Show file tree
Hide file tree
Showing 64 changed files with 217 additions and 4,674 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ lodash inspired utility library for go
------------
## ⚙️ Installation

Make sure you have Go installed ([download](https://go.dev/dl/)). Version `1.13` or higher is required.
Make sure you have Go installed ([download](https://go.dev/dl/)). Version `1.18` or higher is required.

Initialize your project by creating a folder and then running `go mod init github.com/your/repo` ([learn more](https://go.dev/blog/using-go-modules)) inside the folder. Then install Gotil with the [`go get`](https://pkg.go.dev/cmd/go/#hdr-Add_dependencies_to_current_module_and_install_them) command:

```bash
go get -u github.com/gotilty/gotil/v0.0.0
go get -u github.com/gotilty/gotil
```

## Run on Local
Expand Down Expand Up @@ -74,11 +74,10 @@ Listed below are some of the common examples. If you want to see more code examp
#### 📖 [**Each**]

```go
data := []int64{10, 20, 30}
_ = gotil.Each(data, func(val interface{}, i int) {
fmt.Printf("%d apples", val)
gotil.Each([]string{"gotilty", "gotil"}, func(v string) {
fmt.Fprint(os.Stdout, v)
})
// Output: [10 apples 20 apples 30 apples]
// Output: gotiltygotil
```


Expand Down
11 changes: 5 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

## ⚙️ Installation

Make sure you have Go installed ([download](https://go.dev/dl/)). Version `1.13` or higher is required.
Make sure you have Go installed ([download](https://go.dev/dl/)). Version `1.18` or higher is required.

Initialize your project by creating a folder and then running `go mod init github.com/your/repo` ([learn more](https://go.dev/blog/using-go-modules)) inside the folder. Then install Gotil with the [`go get`](https://pkg.go.dev/cmd/go/#hdr-Add_dependencies_to_current_module_and_install_them) command:

```bash
go get -u github.com/gotilty/gotil/v0.0.0-alpha
go get -u github.com/gotilty/gotil
```

## 🎯 Why GOtil?
Expand All @@ -26,9 +26,8 @@ Listed below are some of the common examples. If you want to see more code examp
#### 📖 [**Each**]

```go
data := []int64{10, 20, 30}
_ = gotil.Each(data, func(val interface{}, i int) {
fmt.Printf("%d apples", val)
gotil.Each([]string{"gotilty", "gotil"}, func(v string) {
fmt.Fprint(os.Stdout, v)
})
// Output: [10 apples 20 apples 30 apples]
// Output: gotiltygotil
```
2 changes: 1 addition & 1 deletion docs/_coverpage.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# <b>GO</b>tilty <small>v0.0.0-alpha</small>
# <b>GO</b>tilty <small>v0.1.0</small>

## <i>Next Generation Golang Utility Tool</i>

Expand Down
1 change: 0 additions & 1 deletion docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
- [Crypto](crypto.md)
- [Encoding](encoding.md)
- [Converter](converter.md)
- [Operator](operator.md)

- Contributors
- [ertugrulkutluer](https://github.com/ertugrulkutluer)
Expand Down
28 changes: 6 additions & 22 deletions docs/array.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,16 @@ gotil.Map(val, f)

### examples

>💻 [Try on Playground](https://go.dev/play/p/sgH-q0eERn4)
>💻 [Try on Playground](https://go.dev/play/p/6-D3kaa2UNS)
```go
m1 := []float64{5, 10.5, 10, 10, 20, 20, 10.75, 100, 4.23, 5.15, 5.99, 100.0001}

if result, err := gotil.Map(m1, func(a interface{}, i int) interface{} {
return math.Floor(a.(float64)) * 2
}); err == nil {
for _, v := range result.([]float64) {
fmt.Println(v)
}
}
result := gotil.Map([]int{10, 20}, func(v, i int) int {
return v * v
})
fmt.Println(result)
```

```go
//output:
10
20
20
20
40
40
20
200
8
10
10
200
[100 400]
```
21 changes: 18 additions & 3 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
# Changelog

## > v0.1.0

- Supports Generic

- Removed features
- Operator `IsAssigned()`, `IsNotAssigned()`, `IsArray()`, `IsSlice()`, `IsByteArray()`, `IsBool()`, `IsEmpty()`
, `IsNil()`, `IsEqual()`, `IsStruct()`, `IsPointer()`, `IsChan()`, `IsFunction()`, `IsInteger()`, `IsMap()`
, `IsNumber()`, `IsFloat()`, `IsStruct()`, `IsString()`
- Includes(), Size()
- ToString()

## > v0.0.0-alpha

- Array `Each()`
- Collection `Filter()`, `Find()`, `FindLast()`, `GroupBy()`, `Includes()`, `Map()`, `Reduce()`, `Shuffle()`, `Size()`, `Some()`, `SortBy()`
- Converter `Converter`, `ToArray()`, `ToInt()`, `ToInt8()`, `ToInt16()`, `ToInt32()`, `ToInt64()`, `ToUint()`, `ToUint8()`, `ToUint16()`, `ToUint32()`, `ToUint64()`, `ToFloat32()`, `ToFloat64()`, `ToString()`, `Operator`
- Collection `Filter()`, `Find()`, `FindLast()`, `GroupBy()`, `Includes()`, `Map()`, `Reduce()`, `Shuffle()`, `Size()`
, `Some()`, `SortBy()`
- Converter `Converter`, `ToArray()`, `ToInt()`, `ToInt8()`, `ToInt16()`, `ToInt32()`, `ToInt64()`, `ToUint()`
, `ToUint8()`, `ToUint16()`, `ToUint32()`, `ToUint64()`, `ToFloat32()`, `ToFloat64()`, `ToString()`, `Operator`
- Encoding `HedDecode()`, `HexEncode()`
- Operator `IsAssigned()`, `IsNotAssigned()`, `IsArray()`, `IsSlice()`, `IsByteArray()`, `IsBool()`, `IsEmpty()`, `IsNil()`, `IsEqual()`, `IsStruct()`, `IsPointer()`, `IsChan()`, `IsFunction()`, `IsInteger()`, `IsMap()`, `IsNumber()`, `IsFloat()`, `IsStruct()`, `IsString()`
- Operator `IsAssigned()`, `IsNotAssigned()`, `IsArray()`, `IsSlice()`, `IsByteArray()`, `IsBool()`, `IsEmpty()`
, `IsNil()`, `IsEqual()`, `IsStruct()`, `IsPointer()`, `IsChan()`, `IsFunction()`, `IsInteger()`, `IsMap()`
, `IsNumber()`, `IsFloat()`, `IsStruct()`, `IsString()`
- Crypto `Md5()`
Loading

0 comments on commit 617d0b4

Please sign in to comment.