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: trafficgen.go
    path of file: ./repos/nff-go/examples/nffPktgen/gtp-u
    
    the code of the file until where you have to start completion: // Copyright 2019 Intel Corporation.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package main

import (
	"encoding/json"
	"flag"
	"fmt"
	"os"
	"os/signal"
	"sync/atomic"
	"time"

	"github.com/intel-go/nff-go/flow"
	"github.com/intel-go/nff-go/packet"
	"github.com/intel-go/nff-go/types"

	"github.com/intel-go/nff-go/examples/nffPktgen/generator"
)

type GTPUConfig struct {
	IPv4      generator.IPv4Config `json:"ipv4"`
	StartTEID uint32               `json:"start-teid"`
	MaxTEIDs  uint32               `json:"max-teids"`

    
func validateConfig(gc *GenConfig) error {
	if gc.S1uPort != nil {
		if len(gc.S1uPort.TrafficConfig) > 1 {
			return fmt.Errorf("Currently suppotted mix only of one traffic configuration for S1u interface. Configured %d instead", len(gc.S1uPort.TrafficConfig))
		}
		if gc.S1uPort.GTPUConfig == nil {
			return fmt.Errorf("GTP config should be specified for S1u")
		}
		if gc.S1uPort.GTPUConfig.MaxTEIDs == 0 {
			return fmt.Errorf("GTP configuration should specify non-zero maximum number of possible TEIDs")
		}
		if gc.S1uPort.TrafficConfig[0].Config.DType != generator.ETHERHDR {
			return fmt.Errorf("Only \"ether\" type of traffic is supported for l2")
		}
		if gc.S1uPort.TrafficConfig[0].Config.Ether.DType != generator.IPv4HDR {
			return fmt.Errorf("Only \"ipv4\" type of traffic is supported for l3")
		}
	}
	if gc.SgiPort != nil {
		if len(gc.S1uPort.TrafficConfig) > 1 {
			return fmt.Errorf("Currently suppotted mix only of one traffic configuration for SGi interface. Configured %d instead", len(gc.SgiPort.TrafficConfig))
		}
		if gc.SgiPort.GTPUConfig != nil {
			return fmt.Errorf("GTP config cannot be specified for SGi interface")
		}
		if gc.SgiPort.TrafficConfig[0].Config.DType != generator.ETHERHDR {
			return fmt.Errorf("Only \"ether\" type of traffic is supported for l2")
		}
		if gc.SgiPort.TrafficConfig[0].Config.Ether.DType != generator.IPv4HDR {
			return fmt.Errorf("Only \"ipv4\" type of traffic is supported for l3")
		}
	}
	if gc.S1uPort == nil && gc.SgiPort == nil {
		return fmt.Errorf("Configuration should specify settings either for S1u interface or Sgi interface or both")
	}
	return nil
}