Skip to content

Commit 405b50c

Browse files
RA80533targos
authored andcommitted
doc: use await in filehandle.truncate() snippet
The example snippet of filehandle.close() uses the `await` keyword based on convention. This change updates the example snippet of filehandle.truncate() to similarly use the keyword for the purposes of consistency. PR-URL: #38939 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
1 parent 5218fe8 commit 405b50c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/api/fs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ try {
402402
filehandle = await open('temp.txt', 'r+');
403403
await filehandle.truncate(4);
404404
} finally {
405-
filehandle?.close();
405+
await filehandle?.close();
406406
}
407407
```
408408

0 commit comments

Comments
 (0)