Skip to content

Commit

Permalink
Apply fs code sample fixes to next
Browse files Browse the repository at this point in the history
  • Loading branch information
heitortsergent committed Aug 30, 2024
1 parent 6061a91 commit 15e09f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/sources/next/javascript-api/k6-experimental/fs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ let file;
})();

export default async function () {
// Seek to the beginning of the file
await file.seek(0, SeekMode.Start);

// About information about the file
const fileinfo = await file.stat();
if (fileinfo.name != 'bonjour.txt') {
Expand Down Expand Up @@ -75,9 +78,6 @@ export default async function () {
if (totalBytesRead != fileinfo.size) {
throw new Error('Unexpected number of bytes read');
}

// Seek back to the beginning of the file
await file.seek(0, SeekMode.Start);
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ let file;
})();

export default async function () {
// Seek to the beginning of the file
await file.seek(0, SeekMode.Start);

// About information about the file
const fileinfo = await file.stat();
if (fileinfo.name != 'bonjour.txt') {
Expand Down Expand Up @@ -65,9 +68,6 @@ export default async function () {
if (totalBytesRead != fileinfo.size) {
throw new Error('Unexpected number of bytes read');
}

// Seek back to the beginning of the file
await file.seek(0, SeekMode.Start);
}
```

Expand Down

0 comments on commit 15e09f5

Please sign in to comment.