Skip to content

Commit

Permalink
Change package and add go-swagger example to readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
mwieser committed Jan 11, 2021
1 parent 8b35f85 commit 715f616
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 10 deletions.
55 changes: 49 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Build Status](https://travis-ci.com/kernle32dll/nullable.svg?branch=master)](https://travis-ci.com/kernle32dll/nullable)
[![GoDoc](https://godoc.org/github.com/mwieser/nullable?status.svg)](http://godoc.org/github.com/mwieser/nullable)
[![Go Report Card](https://goreportcard.com/badge/github.com/mwieser/nullable)](https://goreportcard.com/report/github.com/mwieser/nullable)
[![GoDoc](https://godoc.org/github.com/allaboutapps/nullable?status.svg)](http://godoc.org/github.com/allaboutapps/nullable)
[![Go Report Card](https://goreportcard.com/badge/github.com/allaboutapps/nullable)](https://goreportcard.com/report/github.com/allaboutapps/nullable)
[![codecov](https://codecov.io/gh/kernle32dll/nullable/branch/master/graph/badge.svg)](https://codecov.io/gh/kernle32dll/nullable)

# nullable
Expand All @@ -13,13 +13,13 @@ Inspired by [How to determine if a JSON key has been set to null or not provided
To get the package, execute:

```bash
go get github.com/mwieser/nullable
go get github.com/allaboutapps/nullable
```

To import this package, add the following line to your code:

```bash
import "github.com/mwieser/nullable"
import "github.com/allaboutapps/nullable"
```

Refer to it as `nullable`.
Expand All @@ -28,8 +28,8 @@ For more details, see the API documentation.

# Example

``` go
import "github.com/mwieser/nullable"
```go
import "github.com/allaboutapps/nullable"

func main() {
usr := struct {
Expand Down Expand Up @@ -65,6 +65,49 @@ func main() {
}
```

# go-swagger usage example

```yaml
definitions:
NullableInt:
type: integer
example: 1234
x-go-type:
import:
package: github.com/allaboutapps/nullable
type: Int
NullableInt16:
type: integer
example: 1234
x-go-type:
import:
package: github.com/allaboutapps/nullable
type: Int16
NullableFloat:
type: number
format: float
example: 1.5
x-go-type:
import:
package: github.com/allaboutapps/nullable
type: Float32
NullableFloat64:
type: number
format: float
example: 1.5
x-go-type:
import:
package: github.com/allaboutapps/nullable
type: Float64
NullableString:
type: string
example: example
x-go-type:
import:
package: github.com/allaboutapps/nullable
type: String
```
# Contributing
Please feel free to submit issues, fork the repository and send pull requests!
2 changes: 1 addition & 1 deletion examples/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"log"

"github.com/mwieser/nullable"
"github.com/allaboutapps/nullable"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/mwieser/nullable
module github.com/allaboutapps/nullable

go 1.14

Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kN
github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8=
github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
github.com/mwieser/nullable v1.1.0 h1:Igyitt2fNe1TV0jC0KTD95hHZRslaF6mF4Sv5k4CuQk=
github.com/mwieser/nullable v1.1.0/go.mod h1:S73au+dSsJcj6dX7I16qhSwfFYB1d7SudK3Ci6O+Xb4=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down

0 comments on commit 715f616

Please sign in to comment.