Skip to content

Commit

Permalink
Added info about build tags
Browse files Browse the repository at this point in the history
  • Loading branch information
mymmrac committed Nov 27, 2023
1 parent 9f7edd9 commit c89f5f4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ all documentation from Telegram.

For more detailed documentation, see docs at [telego.pixelbox.dev](https://telego.pixelbox.dev).

> Note: Telego uses [fasthttp](https://github.com/valyala/fasthttp) instead of `net/http` by default (can be changed)
> and [go-json](https://github.com/goccy/go-json) instead of `encoding/json`.
> Note: Telego uses [fasthttp](https://github.com/valyala/fasthttp) instead of `net/http`
> and [go-json](https://github.com/goccy/go-json) instead of `encoding/json` by default (both can be changed).
### :clipboard: Table Of Content

Expand All @@ -47,6 +47,7 @@ For more detailed documentation, see docs at [telego.pixelbox.dev](https://teleg
- [:soap: Utility methods](#soap-utility-methods)
- [:mechanical_arm: Helper `With...` methods](#mechanical_arm-helper-with-methods)
- [:sun_behind_large_cloud: Bot handlers](#sun_behind_large_cloud-bot-handlers)
- [:gear: Build configuration](#gear-build-configuration)
- [:art: Contribution](#art-contribution)
- [:star: Stargazers over time](#star-stargazers-over-time)
- [:closed_lock_with_key: License](#closed_lock_with_key-license)
Expand Down Expand Up @@ -599,6 +600,20 @@ func main() {

```

### :gear: Build configuration

[▲ Go Up ▲](#telego--go-telegram-bot-api)

Telego supports multiple build configurations via Go's build tags
(right now only to change JSON encoding/decoding library):

- No tags - use [goccy/go-json](https://github.com/goccy/go-json)
- `sonic` - use [bytedance/sonic](https://github.com/bytedance/sonic)
- `stdjson` - use `encoding/json`

> Note: Use `sonic` only on supported platforms as it has its own limitations, more
> [here](https://github.com/bytedance/sonic?tab=readme-ov-file#requirement).
## :art: Contribution

Contribution guidelines listed [here](docs/CONTRIBUTING.md).
Expand Down
4 changes: 1 addition & 3 deletions internal/json/gojson.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

package json

import (
"github.com/goccy/go-json"
)
import "github.com/goccy/go-json"

var Marshal = json.Marshal
var Unmarshal = json.Unmarshal
Expand Down

0 comments on commit c89f5f4

Please sign in to comment.