code: func (r *StartProgramRequest) UnmarshalBinary(data []byte) error {
  	buf := bytes.NewBuffer(data)
  
  	err := binary.Read(buf, binary.LittleEndian, &r.Body)
  	if err != nil {
  		return err
  	}
  
  	fields := []struct {
  		len uint32
  		val *string
  	}{
  		{r.Body.ProgramPathLength, &r.ProgramPath},
  		{r.Body.ArgumentsLength, &r.Arguments},
  		{r.Body.WorkingDirLength, &r.WorkingDir},
  	}
  
  	for _, field := range fields {
  		if field.len == 0 {
  			continue
  		}
  
  		x := buf.Next(int(field.len))
  		*field.val = string(bytes.TrimRight(x, "\x00"))
  	}
  
  	for i := 0; i < int(r.Body.NumEnvVars); i++ {
  		env, rerr := buf.ReadString(0)
  		if rerr != nil {
  			return rerr
  		}
  
  		env = env[:len(env)-1] // discard NULL terminator
  		r.EnvVars = append(r.EnvVars, env)
  	}
  
  	return nil
  }
docs: // UnmarshalBinary implements the encoding.BinaryUnmarshaler interface