Revert "internal/ui: use errors.New instead of fmt.Errorf"

This reverts commit ed49d8cc9a.

Reason: compile error
This commit is contained in:
Hajime Hoshi 2023-10-16 00:24:41 +09:00
parent ed49d8cc9a
commit 565e944691
2 changed files with 4 additions and 6 deletions

View File

@ -85,7 +85,6 @@ static float deviceScale(uintptr_t java_vm, uintptr_t jni_env, uintptr_t ctx) {
import "C"
import (
"errors"
"fmt"
"golang.org/x/mobile/app"
@ -109,11 +108,11 @@ func (g *graphicsDriverCreatorImpl) newOpenGL() (graphicsdriver.Graphics, error)
}
func (*graphicsDriverCreatorImpl) newDirectX() (graphicsdriver.Graphics, error) {
return nil, errors.Errorf("ui: DirectX is not supported in this environment")
return nil, fmt.Errorf("ui: DirectX is not supported in this environment")
}
func (*graphicsDriverCreatorImpl) newMetal() (graphicsdriver.Graphics, error) {
return nil, errors.Errorf("ui: Metal is not supported in this environment")
return nil, fmt.Errorf("ui: Metal is not supported in this environment")
}
func deviceScaleFactorImpl() float64 {

View File

@ -25,7 +25,6 @@ package ui
import "C"
import (
"errors"
"fmt"
"golang.org/x/mobile/gl"
@ -56,12 +55,12 @@ func (g *graphicsDriverCreatorImpl) newOpenGL() (graphicsdriver.Graphics, error)
}
func (*graphicsDriverCreatorImpl) newDirectX() (graphicsdriver.Graphics, error) {
return nil, errors.Errorf("ui: DirectX is not supported in this environment")
return nil, fmt.Errorf("ui: DirectX is not supported in this environment")
}
func (g *graphicsDriverCreatorImpl) newMetal() (graphicsdriver.Graphics, error) {
if g.gomobileContext != nil {
return nil, errors.Errorf("ui: Metal is not available with gomobile-build")
return nil, fmt.Errorf("ui: Metal is not available with gomobile-build")
}
return metal.NewGraphics()
}