TextText-based

text/x-go

Go Source

Reference for text/x-go, the MIME type for Go (Golang) programming language source code files.

MIME Type Detector

Drop a file to detect its MIME type — no upload, runs in your browser

📄

Drop any file here or click to choose

Expected extensions: .go

HTTP Content-Type Header

HTTP Header
Content-Type: text/x-go; charset=utf-8

Associated File Extensions

.go

Quick Facts

MIME Typetext/x-go
CategoryText
TypeText-based (human-readable)
Extensions.go

Common Usage

Go source files are used for cloud infrastructure (Docker, Kubernetes, Terraform), web servers, CLI tools, microservices, and network programming. Go's simplicity, fast compilation, and excellent concurrency support make it the language of choice for DevOps and backend tooling.

Code Examples

HTML
<!-- Link or embed with explicit type -->
<link rel="stylesheet" href="file.go" type="text/x-go">

<!-- Or for script/media elements -->
<script type="text/x-go" src="file.go"></script>
Node.js
// Express.js
app.get('/file', (req, res) => {
  res.type('text/x-go');
  res.send(data);
});

// Node.js http
res.writeHead(200, { 'Content-Type': 'text/x-go' });
nginx
# nginx.conf — add to types block or use default
types {
    text/x-go  go;
}

# Or set for a specific location
location /api/ {
    default_type text/x-go;
}

Related MIME Types

More Text MIME Types

Other text types in the Text family

Related Tools

Explore More MIME Types

Browse our complete reference of 185 MIME types with usage examples, HTTP headers, and code snippets.