# Os

## Fungsi Create

Fungsi Create dalam package os digunakan untuk membuat file kosong berekstensi tertentu.

### Contoh code

```go
package main

import(
	"log"
	"os"
)

func main() {
	csvfile, err := os.Create("file/bookstore.csv")
	if err != nil {
		log.Panicln("Error create data", err)
	}

	defer func() {
		if err := csvfile.Close(); err != nil {
			log.Panicln("Error closing file", err)
		}
	}()
}
```

## Fungsi Args

Contoh code penggunaan fungsi os Args.

```go
package main

import (
    "fmt"
    "os"
)

func main() {
    args1 := os.Args
    fmt.Println(args1)

    args2 := os.Args
    fmt.Println(args2)

}
```

```
[C:\Users\Lenovo\AppData\Local\Temp\go-build883185711\b001\exe\main.exe]
[C:\Users\Lenovo\AppData\Local\Temp\go-build883185711\b001\exe\main.exe]
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rafli-ramadhan.gitbook.io/golang-example-code-by-topic/package/os.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
