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: kvs.go
    path of file: ./repos/vald/pkg/agent/internal/kvs
    
    the code of the file until where you have to start completion: //
// Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// You may not use this 
    
func (b *bidi) Set(key string, val uint32, ts int64) {
	id := getShardID(key)
	vs, loaded := b.uo[id].LoadOrStore(key, ValueStructUo{value: val, timestamp: ts})
	old := vs.value
	if !loaded { // increase the count only if the key is not exists before
		atomic.AddUint64(&b.l, 1)
	} else {
		b.ou[val&mask].Delete(old)                                    // delete paired map value using old value_key
		b.uo[id].Store(key, ValueStructUo{value: val, timestamp: ts}) // store if loaded for overwrite new value
	}
	b.ou[val&mask].Store(val, valueStructOu{value: key, timestamp: ts}) // store anytime
}