two

package
v0.0.0-...-2efe6f1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package two provide some novel functionality, for use in package testing

Index

Examples

Constants

View Source
const (
	// One is 1
	One int = iota
	// Two is 2
	Two
	Three
	Four
)

A package level constants

Variables

This section is empty.

Functions

func FibFunction

func FibFunction(n int) int

FibFunction uses no objects

Types

type Cache

type Cache map[int]int

Cache fixture for type

var InitCache Cache = map[int]int{0: 0, 1: 1}

InitCache is the initial cache for fib calculation

func NewCache

func NewCache() *Cache

NewCache doc string

type FOneSub

type FOneSub struct {
	FTwo
}

FOneSub use FOne as parent

func (*FOneSub) CalculateSum

func (one *FOneSub) CalculateSum(a, b int) int

CalculateSum return sum of two integers

type FTwo

type FTwo struct {
	// Name of the instance object
	Name string
	// Value of the instance object
	Value string
	// contains filtered or unexported fields
}

FTwo struct doc here

func New

func New() *FTwo

New get a new FTwo object

func (*FTwo) FibCache

func (two *FTwo) FibCache(n int) int

FibNoCache return fibonacci value at sequence index n

Example
fmt.Println(New().FibCache(10))
Output:

55

Jump to

Keyboard shortcuts

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