mirror of
https://github.com/grafana/grafana.git
synced 2024-12-28 18:01:40 -06:00
Backend Readme: Add section on avoiding simplejson (#25116)
This commit is contained in:
parent
fcb9dcb0b8
commit
81e3f93677
@ -71,6 +71,10 @@ Refactor HTTP handlers so that the handler methods are on the HttpServer instanc
|
||||
|
||||
Store newly introduced date columns in the database as epochs if they require date comparison. This permits a unified approach for comparing dates against all the supported databases instead of handling dates differently for each database. Also, by comparing epochs, we no longer need error pruning transformations to and from other time zones.
|
||||
|
||||
### Avoid use of the simplejson package
|
||||
|
||||
Use of the `simplejson` package (`pkg/components/simplejson`) in place of types (Go structs) results in code that is difficult to maintain. Instead, create types for objects and use the Go standard library's [`encoding/json`](https://golang.org/pkg/encoding/json/) package.
|
||||
|
||||
### Provisionable*
|
||||
|
||||
All new features that require state should be possible to configure using config files. For example:
|
||||
|
@ -1,3 +1,5 @@
|
||||
// Package simplejson provides a wrapper for arbitrary JSON objects that adds methods to access properties.
|
||||
// Use of this package in place of types and the standard library's encoding/json package is strongly discouraged.
|
||||
package simplejson
|
||||
|
||||
import (
|
||||
|
Loading…
Reference in New Issue
Block a user