You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: sawtooth.go
    path of file: ./repos/beep/generators
    
    the code of the file until where you have to start completion: package generators

import (
	"errors"
	"math"

	"github.com/faiface/beep"
)

type sawGenerator struct {
	dt float64
	t  flo
    
func SawtoothTone(sr beep.SampleRate, freq float64) (beep.Streamer, error) {
	dt := freq / float64(sr)

	if dt >= 1.0/2.0 {
		return nil, errors.New("faiface sawtooth tone generator: samplerate must be at least 2 times grater then frequency")
	}

	return &sawGenerator{dt, 0, false}, nil
}