all: imp style

This commit is contained in:
f.setrakov
2025-10-24 16:53:48 +03:00
parent b762eaa51c
commit 3bafcd30cd
3 changed files with 5 additions and 6 deletions

View File

@@ -366,7 +366,6 @@ var _ httputil.Middleware = (*authMiddlewareDefault)(nil)
func (mw *authMiddlewareDefault) Wrap(h http.Handler) (wrapped http.Handler) { func (mw *authMiddlewareDefault) Wrap(h http.Handler) (wrapped http.Handler) {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ctx := r.Context() ctx := r.Context()
path := r.URL.Path
if !mw.needsAuthentication(ctx) { if !mw.needsAuthentication(ctx) {
h.ServeHTTP(w, r) h.ServeHTTP(w, r)
@@ -374,6 +373,7 @@ func (mw *authMiddlewareDefault) Wrap(h http.Handler) (wrapped http.Handler) {
return return
} }
path := r.URL.Path
if mw.handleAuthenticatedUser(ctx, w, r, h, path) { if mw.handleAuthenticatedUser(ctx, w, r, h, path) {
return return
} }

View File

@@ -260,9 +260,9 @@ func finalizeWindowsUpdate(ctx context.Context,
var commandConf *executil.CommandConfig var commandConf *executil.CommandConfig
if runningAsService { if runningAsService {
// NOTE: We can't restart the service via "kardianos/service" // NOTE: We can't restart the service via "kardianos/service" package,
// package, because it kills the process first we can't start a new // because it kills the process first we can't start a new instance,
// instance, because Windows doesn't allow it. // because Windows doesn't allow it.
// //
// TODO(a.garipov): Recheck the claim above. // TODO(a.garipov): Recheck the claim above.
commandConf = &executil.CommandConfig{ commandConf = &executil.CommandConfig{

View File

@@ -678,7 +678,6 @@ func run(
done chan struct{}, done chan struct{},
sigHdlr *signalHandler, sigHdlr *signalHandler,
) { ) {
var err error
initEnvironment(ctx, opts, slogLogger) initEnvironment(ctx, opts, slogLogger)
isFirstRun := detectFirstRun() isFirstRun := detectFirstRun()
@@ -687,7 +686,7 @@ func run(
confPath, upd, isCustomURL := initUpdate(ctx, slogLogger, opts, tlsMgr, isFirstRun) confPath, upd, isCustomURL := initUpdate(ctx, slogLogger, opts, tlsMgr, isFirstRun)
dataDir := globalContext.getDataDir() dataDir := globalContext.getDataDir()
err = os.MkdirAll(dataDir, aghos.DefaultPermDir) err := os.MkdirAll(dataDir, aghos.DefaultPermDir)
fatalOnError(errors.Annotate(err, "creating DNS data dir at %s: %w", dataDir)) fatalOnError(errors.Annotate(err, "creating DNS data dir at %s: %w", dataDir))
auth, err := initUsers(ctx, slogLogger, opts.glinetMode) auth, err := initUsers(ctx, slogLogger, opts.glinetMode)