AI 资讯
The Top Golang Mocking Libraries in 2026: A Practical Comparison
Hello, I'm Shrijith Venkatramana. I'm building git-lrc, an AI code reviewer that runs on every commit. Star Us to help devs discover the project. Do give it a try and share your feedback for improving the product. A few years ago, choosing a Go mocking framework was mostly a matter of personal preference. Today, things are different. Most Go developers have at least one AI coding assistant generating tests alongside them. Some teams even generate the majority of their unit tests automatically. Yet one area remains surprisingly messy: mocks. Ask an LLM to write a test for the same interface and you'll often get completely different results depending on whether your project uses GoMock, Mockery, MockIO, Minimock, Moq, or hand-written test doubles. The problem isn't that the models are bad. The problem is that mocking libraries represent very different philosophies: Strict vs flexible Generated vs runtime-created DSL-heavy vs idiomatic Go Feature-rich vs minimalist In this article we'll compare the most popular Go mocking libraries in 2026, examine their strengths and weaknesses, and discuss which one may be the best fit for your project. What Makes a Good Mocking Library? Before comparing tools, it's worth defining what matters. A good mocking library should ideally provide: Easy mock generation Clear test failures Minimal boilerplate Strong refactoring support Good IDE experience Readable tests Reliable call verification Different libraries optimize for different parts of this list. That's why there is no universally correct answer. 1. GoMock: The Enterprise Workhorse GoMock remains one of the most widely used mocking frameworks in the Go ecosystem. Originally created by Google and now actively maintained by Uber, it has become the standard choice for many large organizations. Its philosophy is straightforward: define expectations explicitly and verify them rigorously. Example func TestUserService ( t * testing . T ) { ctrl := gomock . NewController ( t ) repo := New
AI 资讯
Datadog dashboards for prompt regression: the panels we actually keep
We wired our LLM eval suite into Datadog over about four months. Most of the panels we built got deleted. These are the five that stayed, and the metrics that feed them. TL;DR: We run an LLM-as-judge eval suite on every PR that touches a prompt, and we ship the results to Datadog as custom metrics. The dashboard started with fourteen panels. We kept five. The one that catches the most real regressions is per-criterion pass-rate split out by judge criterion, not the single rolled-up pass-rate number, because an aggregate of 91 percent hid the fact that one criterion had dropped from 0.95 to 0.62. Below are the metrics we emit, the Python that submits them, the monitor config we alert on, and the panels we tried and dropped. Some context on the setup so the rest makes sense. We are a Series-C dev-tool startup. We have a handful of prompts in production that do real work (classification, extraction, a summarization step in an agent loop). Each one has an eval set of tagged examples, somewhere between 80 and 400 per prompt. The judge is a separate model call that scores each output against a rubric. We run the suite in GitHub Actions. The eval job emits metrics to Datadog at the end of every run. Backend service health was already in Datadog, so putting eval data next to it meant one place to look during an incident instead of two. 1. Emit per-criterion pass-rate, not just the rolled-up number This is the one that earns its place. Our judge scores each output against multiple criteria. For the extraction prompt it is four: correct fields, no hallucinated fields, format valid, no refusal. Early on we only emitted one number, prompt_eval.pass_rate, the fraction of examples that passed every criterion. That number is fine for a smoke test and useless for debugging. The problem showed up on a prompt change that looked clean. Overall pass-rate went from 0.93 to 0.91. Two points. Nobody would block a PR on two points. But underneath, the "no hallucinated fields" criterion had
开源项目
How to Automate Azure Resource Group Creation with a Bash Script
If you are just getting started with Azure CLI and Bash scripting, this post is for you. I will walk you through how I automated the creation of Azure resource groups for multiple environments using a single Bash script — something that was taking a cloud admin several manual steps every week. This is Project 2 in my TechRush Cloud Engineering bootcamp series. If you want to see where this journey started, you can read my previous post where I tackled deploying a web app across two Azure regions for the first time . That project involved real blockers — quota limits, CLI version mismatches, and a deep dive into Azure Resource Providers. This one went smoother, and I think that is because the previous project was the hard school. The Problem Imagine a cloud administrator who has to create five resource groups every single week, one for each active project: Project-A-RG Project-B-RG Project-C-RG Project-D-RG Project-E-RG Every week. By hand. Management's response was simple: automate it. But here is where the task gets more interesting. Instead of creating one flat resource group per project, the better approach is to create four resource groups per project — one for each environment: Dev Test UAT Production This matters because each environment needs its own access controls, cost tracking, and lifecycle rules. You do not want your Development environment sharing a resource group with Production. Keeping them separate is a real-world cloud best practice, not just a bootcamp exercise. What You Will Need Before running this script, make sure you have the following set up: Azure CLI installed on your local machine. You can follow the official installation guide . An active Azure account . A free account works fine for this. A terminal that runs Bash — Linux, macOS, or WSL on Windows. Understanding the Design The core idea behind this script is parameterization . Instead of hardcoding project names, the script accepts a project name as input and uses it as a prefix for ev
AI 资讯
CRM for appointments
A client of mine is starting a business and needs a CRM. Core functionality is to manage different professionals and assign customers to professionals to make appointments and manage agenda for each professional. I will assist this business on the software side and I am fully capable of developing a custom CRM on my own but it’s not convenient for time/money constraints. I have looked for open source CRMs I can extend so I don’t waste time on UI and common features. Are there products which can save development time? I wanted to evaluate Calendly and integrate it in the final solution, do you have any experience with this product? I would also evaluate existing products but open source I can fork would be best submitted by /u/Umberto_Fontanazza [link] [留言]
AI 资讯
Wispr flow frozen my VS code this week switching to something else
I know I'm not the only one dealing with this because . l've seen other complaints. wispr flow on windows has been freezing my editor. I'll be mid-dictation and the whole thing locks up. not just wispr, but VS Code freezes too. have to force quit both. happened twice this week and one of those times I lost unsaved work because VS Code didn't recover the session properly. the app is electron based and it's eating 800MB of RAM while just sitting in the background doing nothing. my fans spin up when it's idle. for a dictation app. that's absurd. The mac version was fine when I used it on my MacBook but I'm primarily on a windows desktop and the experience there is clearly an afterthought. I've seen people on reddit call it a "mac app with a windows port" and that's generous. also the startup takes like 8-10 seconds. I'll hit my hotkey to start dictating and then wait. and wait. by the time it's ready I could have typed the message. I've been trying willow voice and so far no freezes, no RAM issues, starts instantly. comparable accuracy. anyone else on windows having these issues with wispr? submitted by /u/Ill_Accident_1116 [link] [留言]
AI 资讯
AWS Releases Next Generation of Amazon OpenSearch Serverless
Amazon Web Services has recently announced the general availability of the next generation of Amazon OpenSearch Serverless, with a redesigned architecture that enables 20 times faster resource provisioning than the previous serverless architecture, true scale-to-zero capability, and up to 60% lower cost than a provisioned cluster for peak loads. By Gianmarco Nalin
产品设计
New to QR Code generation. How can I create a code that doesn't expire and can have the destination URL updated in the future?
New to QR Code generation. How can I create a code that doesn't expire and can have the destination URL updated in the future? Does this require a fee-based service? If so any recommendations? submitted by /u/tk2old [link] [留言]
AI 资讯
Made 30+ dev/marketing tools that run 100% in the browser - no backend, no tracking, no login
Quick share of something I built recently. I've been working on a SaaS product and along the way kept needing small utilities for myself: QR codes, UTM links, OG tag previews, schema markup, robots.txt, sitemap, base64/URL encoders, etc. Every site I found for these either required an account, was buried in ads, or made me wonder where my data was going. So I built clean versions and put them at reslug.com/tools . All free. No account. The interesting bit: every tool runs entirely client-side. The QR code generator never sends your WiFi password to a server. The UTM builder never logs your URLs. The schema generator outputs locally. The redirect checker is the only exception, since CORS forces a server proxy for that one (and it doesn't log the URLs it checks). Stack for the free tools: React 19 + Vite + TypeScript + Tailwind, qrcode library for QR generation, all rendered as pure components. Main product behind it is .NET 9 + Postgres but you'd never hit that from /tools. Why I'm posting: curious what's missing. I've got about 27 more tools planned but I'd rather build what people actually need. Also genuinely interested if anyone has feedback on the UI/UX - I rebuilt the hero last week and I'm not 100% sure it's better. https://reslug.com/tools submitted by /u/ervistrupja [link] [留言]
AI 资讯
I built a GitHub Action that reviews AI API costs on every PR — here's what it found in our own codebase
Been building an AI-heavy app for a few months. No visibility into what our AI API calls were actually costing until the Anthropic bill arrived. So I built a GitHub Action that scans for AI usage on every PR and posts a cost analysis comment automatically. First thing it caught in our own codebase: server/services/divergence-detector.js was using claude-sonnet-4-6 with max_tokens=150 to generate 2-sentence explanations. Sonnet costs $15/M output tokens. Haiku costs $4/M. For a 2-sentence output there is zero quality difference. We were paying 3.75x more on every single call and nobody noticed. What it posts on every PR: 💰 Cost delta vs base branch ( "this PR adds +$44/month" ) ⚠️ Warnings for expensive model misuse with specific fix recommendations 🔁 Duplicate AI call patterns that should share a service layer 🔄 Missing retry/backoff logic that will crash under rate limits 💡 Prompt caching opportunities (up to 90% input cost reduction) Supports: Languages: JS, TS, JSX, TSX Providers: Anthropic · OpenAI · Google Gemini · AWS Bedrock · LangChain Zero dependencies · Free Add it to any repo in 2 minutes: - uses: kavyarani7/ai-arch-scanner@v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} threshold: '500' 🔗 GitHub Marketplace 🔗 Repo Happy to answer questions about how it works or what patterns it detects. submitted by /u/Upbeat_Will_3342 [link] [留言]
开源项目
GitHub for Beginners: Answers to some common questions
Find the answers to some of the most common GitHub-related questions. The post GitHub for Beginners: Answers to some common questions appeared first on The GitHub Blog .
AI 资讯
Safe Operating Throughput (SOT) as a First-Class SRE Metric: Derivation and Operationalization
In the summer of 2016, Pokémon GO launched to a user base roughly fifty times larger than its capacity planning had anticipated. The engineering team had done load testing. They had throughput thresholds. They had autoscaling configured. Within hours of launch, the service was degraded globally — not because the infrastructure could not scale, but because it scaled too slowly against an arrival rate that exceeded every modelled scenario, and because the metric that was driving scaling decisions (CPU utilisation) lagged behind the actual saturation signal by several minutes. By the time CPU registered critical, the request queue had already grown to the point where p99 latency had crossed into the range where users were abandoning sessions faster than new sessions were being created. The engineering post-mortem identified the same root cause that appears in the post-mortems of most capacity-related incidents: the organisation's operational metrics were measuring how hard the infrastructure was working, not how much work the service could safely accept. CPU percentage is a resource utilisation metric. Memory percentage is a resource utilisation metric. IOPS is a resource utilisation metric. None of them is a service throughput metric. None of them tells you, with precision, at what arrival rate your SLO begins to degrade. Safe Operating Throughput is that metric. It is not a new concept in queueing theory or systems engineering — the idea of a safe operating ceiling predates modern distributed systems. What is new is its treatment as a first-class SRE metric: formally derived from load test data and SLO targets, continuously monitored for drift, and operationally enforced as a constraint in autoscaling configuration, capacity planning decisions, and deployment pipeline gates. Why Existing Capacity Metrics Are Insufficient The canonical capacity management approach in most organisations works like this: observe CPU or memory utilisation, set an autoscaling threshold (t
AI 资讯
Stop Hardcoding Roles: A Practical Guide to Roles, Permissions, and Scalable Authorization
We've all been there. Your first encounter with authorization looks something like this: if ( user . role === " ADMIN " ) { // allow access } It works. It's simple. It ships fast. And then, three months later, your application has grown, requirements have shifted, and you're staring at a codebase where authorization logic is scattered everywhere—APIs, services, UI components—like a puzzle that nobody remembers how to solve. The truth is: this approach doesn't scale. Not because it's inherently flawed, but because it conflates two very different concepts that should never be mixed. The Core Mistake: Confusing Identity with Capability Here's the problem we're actually trying to solve. As your application grows, you inevitably end up writing code like this: if ( user . role === " BRANCH_MANAGER " || user . role === " SYSTEM_ADMIN " ) { // allow access } Then a stakeholder asks: Can we create a hybrid role? Or: We need Auditors who can export reports but not edit records. And suddenly your role logic explodes into an unmaintainable mess. The fix isn't adding more conditions. The fix is understanding that roles and permissions answer fundamentally different questions. Roles Define Identity Roles are categories of users. Examples: SYSTEM_ADMIN CLIENT BRANCH_MANAGER AUDITOR Roles answer: Who is this user? They establish high-level authorization boundaries. Examples: Staff Portal vs Customer Portal Internal Admin Area vs Public Application Employee Features vs Client Features Think of roles as identity labels . Permissions Define Capability Permissions represent atomic actions. Examples: LOAN_APPROVE USER_DELETE REPORT_EXPORT ACCOUNT_EDIT Permissions answer: What can this user actually do? Your application should not constantly ask: What role are you? Instead, it should ask: Do you have permission to perform this action? Because: Users have Roles Roles contain Permissions Code checks Permissions That distinction changes everything. Always Decouple Identity from Capability T
AI 资讯
LLM Cost Attribution Per Request: How to Track OpenAI and Anthropic Spend by Team and Feature
Per-request attribution starts with five fields on every call: provider, model, input tokens, output tokens, and ownership tags such as team, feature, and customer. A monthly vendor bill cannot explain why one feature, one tenant, or one prompt template suddenly became expensive. Request-level math can. As of June 8, 2026, OpenAI lists GPT-5.4 mini at $0.75 per 1M input tokens and $4.50 per 1M output tokens, while Anthropic lists Claude Sonnet 4 at $3 and $15 respectively. Gateway logs are useful, but they rarely solve AI cost tracking per feature unless you enrich them with business context and retry metadata. The practical operating model is simple: calculate cost on every request, attach ownership dimensions, then roll the data up into team, feature, and customer views. If you are searching for "LLM cost attribution per request," you are usually already past the basic billing problem. You can see your OpenAI or Anthropic invoice, but you cannot answer the questions finance and engineering actually care about: which feature drove the spike, which team owns it, which customers are unprofitable, and which prompt or model change caused the jump. That is why per-request attribution matters. It turns AI spend from a monthly surprise into an operational metric you can act on in the same day. Why LLM cost attribution per request matters now According to the FinOps Foundation's 2025 State of FinOps report, 63% of respondents now manage AI spending, up from 31% the year before. That jump is the real signal. AI cost is no longer a side bucket inside cloud spend. It is becoming a first-class FinOps workload. For teams spending $5,000 to $50,000 per month on LLM APIs, averages break down quickly. A support assistant, an internal coding copilot, and a customer-facing generation feature can all hit the same vendor account while having completely different margins, latency targets, and prompt shapes. If you only look at total spend by provider, you lose the unit economics. Per-r
AI 资讯
Self-Host Postgres or Use Supabase? Here's How to Decide
Short answer first: use Supabase if you want Postgres plus auth, realtime, storage, and a dashboard as one managed bundle. Self-host Postgres – or use a managed Postgres – if you mostly need a database and your app already handles its own auth and logic. The choice is not really "Postgres vs Supabase". It's whether you need the extra layers Supabase puts on top of Postgres. Supabase is not a database Supabase runs on PostgreSQL, but it's a stack of services around it: Postgres – the actual database Auth – user signup, login, JWT tokens Realtime – live updates over websockets Storage – an S3-style file store Edge Functions – serverless functions Studio – dashboard + auto-generated REST/GraphQL API So "self-host Postgres or use Supabase" compares a plain database to a full backend. The honest question: do you need those extra layers, or just the database underneath them? A quick test: You use Supabase Auth, Storage, and Realtime → Supabase earns its place. You use one of them → it's replaceable. You use none and treat it as "Postgres with a nice dashboard" → you want plain Postgres. Side-by-side comparison Factor Supabase (managed) Self-hosted Supabase Plain Postgres (managed or self-hosted) Database engine PostgreSQL PostgreSQL PostgreSQL Built-in auth Yes Yes No (bring your own) Realtime / websockets Yes Yes No File storage Yes Yes No Dashboard + auto API Yes Yes No (use any SQL client) Backups Managed (limits by plan) You manage Managed or you manage Cost shape Metered, grows with usage Server cost + your time Database only Self-host effort None High (many containers) Low–medium Lock-in Medium–high Medium Very low The lock-in point decides it for many teams. Your data is standard Postgres in every option ( pg_dump portable). The lock-in is everything else: Auth tokens, Storage paths, Supabase-specific RLS policies, Edge Function code. The more Supabase-specific features you adopt, the harder the exit. When each option wins Pick managed Supabase when: You're startin
开发者
How do I connect a Spring Boot API to a vanilla HTML/CSS/JS frontend
I’m learning Spring Boot and want to understand how to connect my backend API to a frontend using only vanilla HTML, CSS, and JavaScript first. What would be a good learning path and where can i start? submitted by /u/ThenParamedic4021 [link] [留言]
开源项目
Github "Finish-Up-A-Thon" Challenge Winner Announcement Delayed & General Challenge Timeline Updates
Hey all, we have a quick update for everyone who participated in the GitHub "Finish-Up-A-Thon"...
AI 资讯
Locators & Web-First Assertions (Playwright + TypeScript, Ch.3)
In Chapter 2 we wrote our first tests and hit two bugs. Before we add more, we need the one skill everything else rests on: finding elements reliably . Get this right and your tests survive redesigns; get it wrong and they break every sprint. Code for this chapter is tagged ch-03 in the repo: https://github.com/aktibaba/playwright-qa-course — see src/tests/ui/locators.spec.ts . Locate the way a user perceives The brittle instinct is to grab elements by their structure — CSS classes, nth-child , XPath. All of that changes the moment a developer touches the markup. Playwright's recommended locators instead target what a user (and a screen reader) perceives: the role, the label, the visible text. Use them in this order of preference: getByRole — the role + accessible name (covers the vast majority of cases) getByLabel — form fields by their <label> getByPlaceholder — inputs without a label getByText — non-interactive content getByTestId — a deliberate data-testid , only when nothing semantic fits Here's the top of the priority list, live against Inkwell's home page: import { test , expect } from " @playwright/test " ; test ( " prefer role-based locators over CSS " , async ({ page }) => { await page . goto ( " / " ); await expect ( page . getByRole ( " button " , { name : " Global Feed " })). toBeVisible (); await expect ( page . getByRole ( " link " , { name : " Sign up " })). toBeVisible (); await expect ( page . getByRole ( " heading " , { name : " inkwell " })). toBeVisible (); }); getByRole("button", { name: "Global Feed" }) asserts two things at once — that an element with the button role exists and that its accessible name is "Global Feed". If a dev swaps the <div class="feed-btn"> for a real <button> , this locator keeps working; a CSS selector wouldn't. Strict mode is your friend Playwright locators are strict : if a locator matches more than one element, the action throws instead of silently picking the first. That catches ambiguous tests before they pick the
AI 资讯
Tech Companies Regret Firing Engineers for AI: The Quiet Rehiring Nobody's Talking About [2026]
Tech Companies Regret Firing Engineers for AI: The Quiet Rehiring Nobody's Talking About [2026] Klarna's CEO Sebastian Siemiatkowski stood on stage in 2024 and bragged that AI had replaced 700 customer service employees. The stock market loved it. LinkedIn influencers celebrated. And then, quietly, in 2025, Klarna started hiring humans again. That single reversal tells you everything about why tech companies regret firing engineers for AI. I've watched this pattern unfold across the industry, and a viral YouTube video by Pooja Dutt documenting these failures is now pulling over 10,000 views per day. The audience isn't just curious. They're vindicated. The tech industry laid off over 260,000 workers in 2023 alone, according to Layoffs.fyi , with many companies explicitly citing AI automation as justification. Now, in 2026, the bills are coming due. The companies that swung hardest at the "AI replaces engineers" thesis are the ones scrambling hardest to undo the damage. Why Did Companies Fire Engineers for AI in the First Place? The logic seemed airtight. AI can generate code faster than humans. AI can handle customer queries at scale. AI doesn't need benefits, PTO, or performance reviews. Executives saw a clean line from "AI generates output" to "we need fewer people," and they drew it with a Sharpie. I've been in enough executive planning meetings to know exactly how this plays out. Someone demos an AI tool that produces a working prototype in 20 minutes. The room gets excited. The CFO asks how many engineers they can cut. Nobody asks the harder question: what happens when that prototype needs to survive contact with production? The answer is that it breaks. Badly. Klarna is the poster child, but they're far from alone. Apple has spent two full years struggling with AI-driven improvements to Siri, despite being one of the most well-resourced engineering organizations on the planet. Even with virtually unlimited budget and talent, replacing deep engineering expertise
AI 资讯
Setup & Your First UI + API Tests (Playwright + TypeScript, Ch.2)
In Chapter 1 we argued that automation fails from a lack of structure , not a lack of tooling — and we met Inkwell , the dockerized app we test against. Now we install Playwright + TypeScript and write our first UI and API tests, deliberately simple. We'll also hit two real bugs along the way. I'm leaving them in on purpose — they're the exact problems the framework we build later is designed to prevent. Code for this chapter is tagged ch-02 in the repo: https://github.com/aktibaba/playwright-qa-course Before you start Make sure Inkwell is running (from Chapter 1): cd sut docker compose up -d --build --wait # web :3000, api :3001/api Install Playwright + TypeScript From the repo root: npm install -D @playwright/test typescript @types/node npx playwright install chromium That's it — Playwright bundles its own test runner, assertion library, and TypeScript support. No extra config to make .ts test files work. A minimal config — not a framework yet Two small files keep us honest from day one. First, never hard-code URLs in tests — put them in one place: // src/utils/env.ts export const env = { /** Inkwell SPA (nginx) — the UI base URL. */ webURL : process . env . WEB_URL ?? " http://localhost:3000 " , /** Inkwell API base, including the /api prefix. */ apiURL : process . env . API_URL ?? " http://localhost:3001/api " , } as const ; Then the Playwright config. We split tests into two projects — a fast api project and a Chromium ui project — because API tests need no browser and should run in milliseconds: // playwright.config.ts import { defineConfig , devices } from " @playwright/test " ; import { env } from " ./src/utils/env " ; export default defineConfig ({ testDir : " ./src/tests " , fullyParallel : true , reporter : " list " , use : { trace : " on-first-retry " , screenshot : " only-on-failure " }, projects : [ { name : " api " , testDir : " ./src/tests/api " , use : { baseURL : env . apiURL } }, { name : " ui " , testDir : " ./src/tests/ui " , use : { baseURL : e
AI 资讯
A Practical Intro to Spec-Driven Development (SDD)
When we build something complex—whether it’s a skyscraper, a gourmet meal, or a piece of software—we usually start with a plan. In software development, however, it’s easy to skip that step. We often jump straight into implementation, focusing on how to write the code instead of the intent behind it. Over time, this leads to rework, confusion, and systems that don't quite match our original goals. Spec-Driven Development (SDD) is an approach that shifts the focus back to the plan. Instead of starting with code, you start with a Specification : a clear, structured description of what the software should do. You then use an AI coding agent as a high-speed collaborator to help turn that specification into working code. 🔍 What is a “Spec”? A Specification (or “Spec”) is a written contract between your intention and the final product. It isn't a 50-page manual; it's a living document that defines: What the system should do. How it should behave in different scenarios. Which constraints and rules it must follow. From Prompts to Specifications There is a massive difference between a vague prompt and a structured spec. Loose prompts often lead to inconsistent results and "hallucinations," whereas clear specifications give the AI a much better target to hit. Bad Prompt: > “Build me a login system.” Good Spec: A good spec provides the clarity an AI (or a human) needs to succeed. You don’t need a 10-page document to benefit from specs; you need clarity, not length. 🛠️ Example Spec: Login Endpoint Overview Allow users to log in using email and password. Endpoint POST /api/login Request { "email" : "user@example.com" , "password" : "string" } Behavior Success: If email and password are correct → return a token and user info. Invalid Credentials: If credentials don't match → return INVALID_CREDENTIALS . Invalid Input: If fields are empty or the email format is wrong → return INVALID_INPUT . Rules Passwords must be stored hashed (e.g., bcrypt). Token expires in 24 hours. Security: