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

uber-go / dig / 359
93%
master: 87%

Build:
Build:
LAST BUILD BRANCH: ajs-vals
DEFAULT BRANCH: master
Ran 01 Jun 2017 11:58PM UTC
Jobs 2
Files 1
Run time 15s
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
359

push

travis-ci

web-flow
dig.Param: Recurse into nested parameter objects (#73)

This change adds support to parameter objects for recursing into fields that
are also parameter objects. That is, this change allows the following,

    type OutputConfig struct {
        dig.Param

        Writer io.Writer
    }

    type Config struct {
        dig.Param

        Input io.Reader
        Output OutputConfig
    }

    func NewTransport(cfg Config) (*Transport, error) { .. }

Besides the usefulness of treating fields similar to constructor parameters,
there's another motivating use case for this: Aliasing `dig.Param`. Without
this change, we have special handling for the `dig.Param` type, opting it out
of resolution from `dig`. If a library author wants to use their own type in
place of `dig.Param` (for example, `fx.Param`), they can't quite do this
because any alias of `dig.Param` is a different type; one which the library
does not special-case.

    package fx

    type Param dig.Param

    type Config struct {
        Param

        Input io.Reader
    }

    // The above with fail because dig doesn't know how to resolve fx.Param.

With this change, Fx will be able to support the following.

    package fx

    type Param struct{ dig.Param }

    type Config struct {
        Param

        // ..
    }

197 of 213 relevant lines covered (92.49%)

47.15 hits per line

Coverage Regressions

Lines Coverage ∆ File
11
100.0
dig.go
Jobs
ID Job ID Ran Files Coverage
1 359.1 01 Jun 2017 11:58PM UTC 0
92.49
Travis Job 359.1
2 359.2 01 Jun 2017 11:58PM UTC 0
92.49
Travis Job 359.2
Source Files on build 359
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #359
  • 536cb762 on github
  • Prev Build on dev (#345)
  • Next Build on dev (#361)
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

© 2026 Coveralls, Inc