go-adaptive-functions

module
v0.0.0-...-ed4a9a5 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: MIT

README

CircleCI Go Report Card GoDoc license

go-adaptive-functions

Description

go-adaptive-functions is a library of adaptive Go functions used by gotmpl, go-dfl and railgun.

Usage

Go

You can import go-adaptive-functions as a library with:

import (
  "github.com/spatialcurrent/go-adaptive-functions/pkg/af"
)

See af in GoDoc for API documentation and examples.

Node

AF is built as a module. In modern JavaScript, the module can be imported using destructuring assignment.

const { sum, min, max } = require('./dist/af.mod.min.js');

In legacy JavaScript, you can use the af.global.js file that simply adds af to the global scope.

Releases

go-adaptive-functions is currently in alpha. See releases at https://github.com/spatialcurrent/go-adaptive-functions/releases. See the Building section below to build from scratch.

JavaScript

  • af.global.js, af.global.js.map - JavaScript global build with source map
  • af.global.min.js, af.global.min.js.map - Minified JavaScript global build with source map
  • af.mod.js, af.mod.js.map - JavaScript module build with source map
  • af.mod.min.js, af.mod.min.js.map - Minified JavaScript module with source map

Examples

Go

See the examples in GoDoc.

JavaScript

See the examples/js/index.js file. You can run the example with make run_example_javascript.

Building

Use make help to see help information for each target.

JavaScript

You can compile go-adaptive-functions to pure JavaScript with the make build_javascript script.

Testing

Go

To run Go tests use make test_go (or bash scripts/test.sh), which runs unit tests, go vet, go vet with shadow, errcheck, ineffassign, staticcheck, and misspell.

JavaScript

To run JavaScript tests, first install Jest using make deps_javascript, use Yarn, or another method. Then, build the JavaScript module with make build_javascript. To run tests, use make test_javascript. You can also use the scripts in the package.json.

Contributing

Spatial Current, Inc. is currently accepting pull requests for this repository. We'd love to have your contributions! Please see Contributing.md for how to get started.

License

This work is distributed under the MIT License. See LICENSE file.

Directories

Path Synopsis
pkg
af
Package af contains a set of adapative functions.
Package af contains a set of adapative functions.

Jump to

Keyboard shortcuts

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