• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gernest / bearcub / 8
83%
master: 83%

Build:
Build:
LAST BUILD BRANCH: rewrite
DEFAULT BRANCH: master
Ran 19 Aug 2017 03:46PM UTC
Jobs 1
Files 1
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
8

push

travis-ci

gernest
Use text/template to render variable replacement

This is a new implementation of ReplaceString which uses text/template for heavy lifting.

What it does is first the input is rewritten to tags that are going to be identified by text/emplate, then the rewritten template is passed to text/template for rendering.

The special tags are `<<` and `>>` so,  `{host}` becomes `<< replace "host">>` where replace is the template function with signature `func(string)string`

This will work well with json, the fact here is we can later change special tags to be unique to any particular text format that way the function can be used on xml etc.

The replaced variables are handled by the end user meaning not only can json objects be adressed but aslo arbitrary logic can be handled since templating is separaed from replacement

72 of 72 new or added lines in 1 file covered. (100.0%)

99 of 120 relevant lines covered (82.5%)

12.87 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
14
100.0
variable.go
Jobs
ID Job ID Ran Files Coverage
1 8.1 19 Aug 2017 03:46PM UTC 0
82.5
Travis Job 8.1
Source Files on build 8
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #8
  • b880000a on github
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc