pool

package
v0.0.1-rc5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get() *fieldContainer

Get selects an arbitrary item from the field Pool, removes it from the field Pool, and returns it to the caller. Get may choose to ignore the field pool and treat it as empty. Callers should not assume any relation between values passed to Put and the values returned by Get.

NOTE: This function should be call Put to give back. NOTE: You should know `sync.Pool` work principle ```go

fc := logger.Get() defer logger.Put(fc) fc.Fields = append(fc.Fields, logger.String("k1", "v1")) ... use fc.Fields

```

func Put

func Put(c *fieldContainer)

Put adds x to the pool. NOTE: See Get.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL