blob: c5c931aa219d48be1bfd9e2a89eb7162794110d7 [file] [log] [blame]
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// The following enables go generate to generate the doc.go file.
//go:generate go run $V23_ROOT/release/go/src/ . -help
package main
import (
_ ""
var name string
func main() {
cmdHelloClient.Flags.StringVar(&name, "name", "", "Name of the hello server.")
var cmdHelloClient = &cmdline.Command{
Runner: v23cmd.RunnerFunc(runHelloClient),
Name: "helloclient",
Short: "Simple client mainly used in regression tests.",
Long: `
Command helloclient is a simple client mainly used in regression tests.
func runHelloClient(ctx *context.T, env *cmdline.Env, args []string) error {
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
defer cancel()
var result string
err := v23.GetClient(ctx).Call(ctx, name, "Hello", nil, []interface{}{&result})
if err != nil {
return errors.New(verror.DebugString(err))
if got, want := result, "hello"; got != want {
return fmt.Errorf("Unexpected result, got %q, want %q", got, want)
return nil