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: logging_test.go
    path of file: ./repos/consul-template/logging
    
    the code of the file until where you have to start completion: // Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package logging

import (
	"bytes"
	"fmt"
	"io"
	"strings"
	"testing"
	"time"
)

func TestNow(t *testing.T) {
	checkTime := func(timeStamp string) {
		logTime, err := time.Parse(timeFmt, tim
    
func TestNow(t *testing.T) {
	checkTime := func(timeStamp string) {
		logTime, err := time.Parse(timeFmt, timeStamp)
		if err != nil {
			t.Fatal("log time failed to parse:", err)
		}
		if time.Now().Before(logTime) {
			t.Fatal("log happened in the future?")
		}
	}
	// we just want to be sure now() returns a valid date string
	checkTime(now())

	// pull apart log message and check timestamp
	var buf bytes.Buffer
	config := newConfig(&buf)
	writer, err := newWriter(config)
	if err != nil {
		t.Fatal(err)
	}
	writer.Write([]byte("XXX"))
	logSplit := strings.Split(buf.String(), " ")
	checkTime(logSplit[0])
	if logSplit[1] != "XXX" {
		t.Fatalf("Where'd the XXX go?\n(%#v)", logSplit)
	}
}