codeclimate/test-reporter

View on GitHub
formatters/gocov/example/foo/foo.go

Summary

Maintainability
A
0 mins
Test Coverage
package foo

import "fmt"

type Foo struct {
    anotherFoo interface{}
}

func New(foo interface{}) *Foo {
    return &Foo{
        anotherFoo: foo,
    }
}

func (f *Foo) String() string {
    i, ok := f.anotherFoo.(interface{ String() string })
    if ok {
        return fmt.Sprintf("foo %s", i)
    }
    return "foo"
}