Skip to content
This repository has been archived by the owner on Feb 17, 2024. It is now read-only.

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Achille Roussel <[email protected]>
  • Loading branch information
achille-roussel committed May 28, 2023
1 parent 0610bcc commit f87e27a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
6 changes: 3 additions & 3 deletions internal/cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Usage: timecraft get <resource> [options]
The get sub-command gives access to the state of the time machine registry.
The command must be followed by the name of resources to display, which must
be one of config, module, process, or runtime (the command also accepts plural
and abbreviations of the resource names).
be one of config, module, process, or runtime.
(the command also accepts plurals and abbreviations of the resource names)
Examples:
Expand Down Expand Up @@ -59,7 +59,7 @@ type resource struct {
var resources = [...]resource{
{
name: "config",
alt: []string{"configs"},
alt: []string{"conf", "configs"},
get: getConfigs,
},
{
Expand Down
3 changes: 3 additions & 0 deletions internal/cmd/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import (
const helpUsage = `
Usage: timecraft <command> [options]
Registry Commands:
get Display resources from the time machine registry
Runtime Commands:
run Run a WebAssembly module, and optionally trace execution
replay Replay a recorded trace of execution
Expand Down
7 changes: 3 additions & 4 deletions internal/object/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ import (
"strings"
"time"

"golang.org/x/exp/slices"

"github.com/stealthrocket/timecraft/internal/object/query"
"github.com/stealthrocket/timecraft/internal/stream"
"golang.org/x/exp/slices"
)

var (
Expand Down Expand Up @@ -206,8 +205,8 @@ func (store dirStore) CreateObject(ctx context.Context, name string, data io.Rea
return err
}

tagsPath := ""
tagsData := []byte(nil)
var tagsPath string
var tagsData []byte
if len(tags) > 0 {
for _, tag := range tags {
if !validTag(tag) {
Expand Down
3 changes: 3 additions & 0 deletions internal/stream/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ func Copy[T any](w Writer[T], r Reader[T]) (int64, error) {
if err != nil {
return n, err
}
if wn < rn {
return n, io.ErrNoProgress
}
}

if err != nil {
Expand Down

0 comments on commit f87e27a

Please sign in to comment.