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: hash.go
    path of file: ./repos/kubernetes/staging/src/k8s.io/kubectl/pkg/util/hash
    
    the code of the file until where you have to start completion: /*
Copyright 2017 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the Li
    
func encodeSecret(sec *v1.Secret) (string, error) {
	m := map[string]interface{}{
		"kind": "Secret",
		"type": sec.Type,
		"name": sec.Name,
		"data": sec.Data,
	}
	if sec.Immutable != nil {
		m["immutable"] = *sec.Immutable
	}
	// json.Marshal sorts the keys in a stable order in the encoding
	data, err := json.Marshal(m)
	if err != nil {
		return "", err
	}
	return string(data), nil
}