golang/website

repository·master·Indexed 19 days ago

https://github.com/golang/website

Repository managing the content and serving infrastructure for go.dev and golang.org. It includes server code, web assets (JS, TS, CSS), and the Go Tour. Documentation covers creating blog articles using the .article format, deploying admin applications to Google App Engine, running local development servers, and performing regression and visual screentests.

Tokens
150.1K
Snippets
512
Records
947
Agent score
62%

What's inside golang-website

  1. Overview of the pkg.go.dev API

    master
    The pkg.go.dev API is a stateless, GET-only service interface designed for programmatic access to Go module and package metadata. It is intended for developers building tools, IDE integrations, and automated workflows. Currently, the API is in a v1beta phase, with endpoints hosted under the /v1beta path. The API prioritizes precision; unlike the web interface which uses the 'longest module path' rule to resolve ambiguity, the API requires clients to specify modules explicitly if a package path exists in multiple modules.
  2. Common Tech Stacks for Go Developers (2023 H2 Survey)

    master

    Based on the 2023 H2 Go Developer Survey, the following technologies are commonly used in Go development environments:

    • Cloud Platforms: Go is heavily used for cloud-based development. AWS (48%) and GCP (29%) are the most common providers. Microsoft Azure is notably more prevalent in large organizations (> 1,000 employees).
    • Databases: 91% of Go services use at least one database. PostgreSQL is the most frequent choice (59%).
    • Caches/Key-Value Stores: 68% of respondents use these, with Redis (57%) being the leader, followed by etcd (10%) and memcached (7%).
    • Observability: Prometheus and Grafana are the most common (43% each), with Open Telemetry, Datadog, and Sentry also seeing significant use.
    • Data Formats: JSON is nearly universal (96%). YAML, CSV, and protocol buffers are used by approximately 50% of respondents.
    • Authentication: Most developers build upon standards like JWT and OAuth2.
    • Other Services: gRPC (47%) and Terraform (25%) are common. Other notable tools include Apache Kafka, ElasticSearch, GraphQL, and RabbitMQ.
  3. Understand Go 2018 Survey Results and Community Sentiment

    master

    The 2018 Go Survey provides insights into developer satisfaction, challenges, and development environments. Key metrics include:

    • Net Promoter Score (NPS): A measure of community sentiment ranging from -100 to 100. The 2018 score was 61.
    • Developer Satisfaction: High satisfaction levels were reported, with 89% happy with Go and 85% preferring it for their next project.
    • Top Challenges: Developers identified package management, differences from other programming languages, and the lack of generics as primary hurdles.
    • Performance Satisfaction: High satisfaction was noted for CPU performance, build speed, and memory utilization, while debuggability and binary size showed room for improvement.
  4. Use the runtime/trace package for execution tracing

    master

    The runtime/trace package allows you to produce a trace of each goroutine's execution over a period of time. This is useful for identifying concurrency bottlenecks, such as goroutines blocking on channels, which might not be visible in CPU profiles. You can visualize these traces using the go tool trace command or the gotraceui tool.

    To correlate high-level application logic with low-level execution details, you can instrument your code using:

    • Task
    • WithRegion
    • Log
    import "runtime/trace"
    // Use trace.Task, trace.WithRegion, or trace.Log to instrument your program.
  5. Analyze Go learning challenges and preferences from the 2024 H1 Survey

    master

    The Go Developer Survey 2024 H1 results highlight several key areas regarding how developers learn Go and the obstacles they face:

    Learning Goals

    • Basics vs. Advanced: Only 3% of respondents are currently learning the basics. 40% have mastered the basics and want to learn advanced topics, and 40% focus on helping others learn.
    • Experience Correlation: Developers with less than three months of experience are more likely to be learning the basics (30%) compared to the general respondent pool.

    Preferred Learning Formats

    • Written Content: The most preferred format at 87%.
    • Video Content: Preferred by 52% of respondents, with a higher preference noted among developers with less experience.

    Primary Learning Challenges

    • Time and Motivation: The most common challenge (44%) is a lack of time or personal limitations (focus/motivation).
    • New Concepts: 11% struggle with learning Go-specific idioms, best practices, or adapting from dynamically typed languages (like Python or JavaScript) to Go's statically typed, compiled nature.
    • Code Organization: Developers specifically cited difficulty in learning how to organize Go code and a lack of examples for enterprise-level, modular, or 'clean architecture' projects.
    • Documentation and Examples: There is a demand for more real-world examples and documentation that provides context beyond sparse technical references.

    Insights for Onboarding Others

    For those whose goal is to help others get started, key recommendations include:

    • Project-based learning: Providing realistic examples or project-based exercises.
    • Language Comparisons: Helping developers coming from other ecosystems by comparing Go concepts to those in their previous languages.
    • Philosophical Context: Providing more explanations regarding Go's philosophy and the why behind its best practices, not just the what.
  6. Analyze Go Developer Survey 2024 H1 Results

    master

    The Go Developer Survey 2024 H1 results provide insights into the developer ecosystem, including preferred operating systems, editors, deployment targets, and cloud provider usage. Key findings include:

    • Operating Systems: Most developers use Linux (61%) or macOS (58%). Windows users are more prevalent in random samples from JetBrains and VS Code compared to self-selected groups.
    • WSL Usage: Among the 17% of respondents using WSL, 93% use WSL2. The Go team at Microsoft is focusing efforts on WSL2.
    • Code Editors: The most common editors are VS Code (43%) and GoLand (33%).
    • Deployment: 93% of Go software is deployed to Linux environments.
    • Cloud Platforms: AWS (52%) and GCP (27%) are the most used providers. Microsoft Azure is significantly more common in large organizations (> 1,000 employees).
    • Satisfaction: Satisfaction rates for Go on AWS and GCP are both 77%, while Azure satisfaction is lower at 57%.
  7. Analyze Go Development Environments and Editor Preferences

    master

    The survey highlights the tools and operating systems used by the Go community:

    • Operating Systems: Linux (65%) and macOS (50%) are the most common, with 41% of respondents using multiple OSes.
    • Editors: VS Code is the most popular editor (>33%), followed by GoLand (22%) and Vim (17%).
    • Editor Improvement Requests: The most requested improvements for Go editor support are improved debugging support (e.g., live debugging) and improved code completion (e.g., smarter autocomplete).
    • Deployment Architectures: x86/x86-64 is the primary platform (76%), with significant interest in ARM64 (45%) and WebAssembly (30%).
  8. Use tmplfunc to invoke templates as functions

    master
    The tmplfunc package extends Go's standard template capabilities by allowing templates to be invoked directly within other templates as if they were standard functions. This enables modular template design where one template can act as a reusable component called by others.
  9. Go Developer Survey 2024 H1 Results Overview

    master
    The Go Developer Survey 2024 H1 results provide insights into developer sentiment, trust in the Go team, community satisfaction, and the challenges faced by Go developers. Key findings include a 93% satisfaction rate with Go and a high level of trust (80%) in the Go team's ability to evolve the language. The survey also highlights how developers are utilizing Go for AI-powered applications, noting that while Go is seen as a strong production platform, many organizations currently start AI work in Python due to the existing ecosystem. Common challenges identified include learning Go best practices and the verbosity of error handling.
  10. Performance improvements in Go 1.8

    master

    Go 1.8 introduced several performance optimizations across the runtime and standard library:

    • Garbage Collector: Significant reduction in GC pause times, typically under 100 microseconds and often as low as 10 microseconds.
    • Defer Statements: The overhead of deferred function calls has been reduced by approximately 50%.
    • Cgo: The overhead of calls from Go into C has been reduced by approximately 50%.
    • Standard Library: Optimizations were applied to several packages, including bytes, crypto/*, encoding/*, hash/crc32, image/*, math/*, reflect, runtime, strconv, strings, syscall, text/template, and unicode/utf8.
  11. Understand Go 1.12 Runtime performance and profiling changes

    master

    Go 1.12 introduced several runtime improvements:

    • Sweeping Performance: Improved performance when a large fraction of the heap remains live, reducing allocation latency after garbage collection.
    • Memory Release: The runtime releases memory back to the OS more aggressively.
    • Timer and Deadline Scaling: Timer and deadline code is faster and scales better with high CPU counts, specifically improving network connection deadline performance.
    • Memory Profiling: Improved accuracy by fixing overcounting of large heap allocations.
    • Tracebacks and Stack Traces: runtime.Caller, runtime.Callers, and tracebacks no longer include compiler-generated initialization functions. During global variable initialization, these will appear as PKG.init.ializers.
  12. Top challenges facing Go developers

    master

    The 2025 survey identified three primary frustrations for Go developers:

    1. Ensuring code follows best practices/idioms (33%): Developers often seek more official guidance and tooling to enforce project structure and idiomatic patterns.
    2. Missing features from other languages (28%): Common requests include improved error handling/reporting patterns, enums/sum types, nil pointer safety, and increased expressivity.
    3. Finding trustworthy Go modules (26%): Developers struggle to distinguish high-quality, maintained modules from marginal or one-off projects. Desired 'quality signals' include project activity, code quality, adoption trends, and organizational support.