Skip to content

Commit 15e09f5

Browse files
Apply fs code sample fixes to next
1 parent 6061a91 commit 15e09f5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/sources/next/javascript-api/k6-experimental/fs/_index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ let file;
4545
})();
4646

4747
export default async function () {
48+
// Seek to the beginning of the file
49+
await file.seek(0, SeekMode.Start);
50+
4851
// About information about the file
4952
const fileinfo = await file.stat();
5053
if (fileinfo.name != 'bonjour.txt') {
@@ -75,9 +78,6 @@ export default async function () {
7578
if (totalBytesRead != fileinfo.size) {
7679
throw new Error('Unexpected number of bytes read');
7780
}
78-
79-
// Seek back to the beginning of the file
80-
await file.seek(0, SeekMode.Start);
8181
}
8282
```
8383

docs/sources/next/javascript-api/k6-experimental/fs/file/_index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ let file;
3535
})();
3636

3737
export default async function () {
38+
// Seek to the beginning of the file
39+
await file.seek(0, SeekMode.Start);
40+
3841
// About information about the file
3942
const fileinfo = await file.stat();
4043
if (fileinfo.name != 'bonjour.txt') {
@@ -65,9 +68,6 @@ export default async function () {
6568
if (totalBytesRead != fileinfo.size) {
6669
throw new Error('Unexpected number of bytes read');
6770
}
68-
69-
// Seek back to the beginning of the file
70-
await file.seek(0, SeekMode.Start);
7171
}
7272
```
7373

0 commit comments

Comments
 (0)