Skip to content

feat: return better error if file size is too big to upload #7775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 5, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
t.Parallel unit test
  • Loading branch information
Emyrk committed Jun 5, 2023
commit 3e368a44efd39c056c39bc24df714d028ae3d5f7
4 changes: 4 additions & 0 deletions coderd/util/xio/limitwriter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
)

func TestLimitWriter(t *testing.T) {
t.Parallel()

type writeCase struct {
N int
ExpN int
Expand Down Expand Up @@ -106,6 +108,8 @@ func TestLimitWriter(t *testing.T) {

for _, c := range testCases {
t.Run(c.Name, func(t *testing.T) {
t.Parallel()

buf := bytes.NewBuffer([]byte{})
allBuff := bytes.NewBuffer([]byte{})
w := xio.NewLimitWriter(buf, c.L)
Expand Down