Unexport templateInput.

I did not know you could do that 2 years ago.
This commit is contained in:
Hendrik van Wyk
2017-09-14 21:34:43 +02:00
parent 38094da9de
commit f0420ebdc1

View File

@@ -91,8 +91,7 @@ func NewWebGui(source datasource.DataPoller, batteryCapacity float64) *WebGui {
return w return w
} }
//TemplateInput is exported to be used as an argument to the http template package. type templateInput struct {
type TemplateInput struct {
Error error Error error
Date string Date string
@@ -128,12 +127,12 @@ func (w *WebGui) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
} }
} }
func buildTemplateInput(statusErr *statusProcessed) *TemplateInput { func buildTemplateInput(statusErr *statusProcessed) *templateInput {
status := statusErr.status status := statusErr.status
outPower := status.OutVoltage * status.OutCurrent outPower := status.OutVoltage * status.OutCurrent
inPower := status.InCurrent * status.InVoltage inPower := status.InCurrent * status.InVoltage
tmpInput := &TemplateInput{ tmpInput := &templateInput{
Error: statusErr.err, Error: statusErr.err,
Date: time.Now().Format(time.RFC1123Z), Date: time.Now().Format(time.RFC1123Z),
OutCurrent: fmt.Sprintf("%.3f", status.OutCurrent), OutCurrent: fmt.Sprintf("%.3f", status.OutCurrent),