go.os
1.23.1.5
dotnet add package go.os --version 1.23.1.5
NuGet\Install-Package go.os -Version 1.23.1.5
<PackageReference Include="go.os" Version="1.23.1.5" />
<PackageVersion Include="go.os" Version="1.23.1.5" />
<PackageReference Include="go.os" />
paket add go.os --version 1.23.1.5
#r "nuget: go.os, 1.23.1.5"
#:package go.os@1.23.1.5
#addin nuget:?package=go.os&version=1.23.1.5
#tool nuget:?package=go.os&version=1.23.1.5
go.os
C# package converted from the Go standard library by go2cs.
Package os provides a platform-independent interface to operating system functionality. The design is Unix-like, although the error handling is Go-like; failing calls return values of type error rather than error numbers. Often, more information is available within the error. For example, if a call that takes a file name fails, such as [Open] or [Stat], the error will include the failing file name when printed and will be of type [*PathError], which may be unpacked for more information.
The os interface is intended to be uniform across all operating systems. Features not generally available appear in the system-specific package syscall.
Here is a simple example, opening a file and reading some of it.
file, err := os.Open("file.go") // For read access.
if err != nil {
log.Fatal(err)
}
If the open fails, the error string will be self-explanatory, like
open file.go: no such file or directory
The file's data can then be read into a slice of bytes. Read and Write take their byte counts from the length of the argument slice.
data := make([]byte, 100)
count, err := file.Read(data)
if err != nil {
log.Fatal(err)
}
fmt.Printf("read %d bytes: %q\n", count, data[:count])
Concurrency
The methods of [File] correspond to file system operations. All are safe for concurrent use. The maximum number of concurrent operations on a File may be limited by the OS or the system. The number should be high, but exceeding it may degrade performance or cause other issues.
Copyright 2009 The Go Authors. All rights reserved. This C# package is converted from Go standard library source; use of that source is governed by a BSD-style license that can be found in the LICENSE file. The go2cs conversion itself is distributed under the MIT license.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- go.errors (>= 1.23.1.5)
- go.internal.bytealg (>= 1.23.1.5)
- go.internal.byteorder (>= 1.23.1.5)
- go.internal.filepathlite (>= 1.23.1.5)
- go.internal.goarch (>= 1.23.1.5)
- go.internal.godebug (>= 1.23.1.5)
- go.internal.itoa (>= 1.23.1.5)
- go.internal.poll (>= 1.23.1.5)
- go.internal.stringslite (>= 1.23.1.5)
- go.internal.syscall.execenv (>= 1.23.1.5)
- go.internal.syscall.unix (>= 1.23.1.5)
- go.internal.syscall.windows (>= 1.23.1.5)
- go.internal.testlog (>= 1.23.1.5)
- go.io (>= 1.23.1.5)
- go.io.fs (>= 1.23.1.5)
- go.lib (>= 1.23.1.5)
- go.runtime (>= 1.23.1.5)
- go.slices (>= 1.23.1.5)
- go.sync (>= 1.23.1.5)
- go.sync.atomic (>= 1.23.1.5)
- go.syscall (>= 1.23.1.5)
- go.time (>= 1.23.1.5)
- go.unsafe (>= 1.23.1.5)
NuGet packages (65)
Showing the top 5 NuGet packages that depend on go.os:
| Package | Downloads |
|---|---|
|
go.fmt
fmt (net9.0 - Release) -- C# project converted from Go source |
|
|
go.path.filepath
path.filepath (net9.0 - Release) -- C# project converted from Go source |
|
|
go.log
log (net9.0 - Release) -- C# project converted from Go source |
|
|
go.crypto.rand
crypto.rand (net9.0 - Release) -- C# project converted from Go source |
|
|
go.net
net (net9.0 - Release) -- C# project converted from Go source |
GitHub repositories
This package is not used by any popular GitHub repositories.